Questions tagged [numeric]

This tag is for questions concerning problems using numbers which either cannot be exactly solved, or where the exact solution may be much more difficult to acquire than by using numerical methods.

This tag is for questions concerning problems using numbers which either cannot be exactly solved, or where the exact solution may be much more difficult to acquire than by using numerical methods.

It includes questions about algorithms, precision and accuracy of underlying numbers, advantages and disadvantages of several methods, error propagation, problems with the underlying numbers and data structures.

2593 questions
13
votes
2 answers

HiveQL - How to find the column value is numeric or not using any UDF?

Basically i would like to return rows based on one column value. If the column contains non numeric values, then return those rows from a hive table. Any UDF is available in Hive?
Shankar
  • 8,529
  • 26
  • 90
  • 159
13
votes
7 answers

How can I create an enum using numbers?

Is it possible to make an enum using just numbers in C#? In my program I have a variable, Gain, that can only be set to 1, 2, 4, and 8. I am using a propertygrid control to display and set this value. If I were to create an enum like this... …
PICyourBrain
  • 9,976
  • 26
  • 91
  • 136
13
votes
3 answers

Is C floating-point non-deterministic?

I have read somewhere that there is a source of non-determinism in C double-precision floating point as follows: The C standard says that 64-bit floats (doubles) are required to produce only about 64-bit accuracy. Hardware may do floating point…
Lucas Membrane
  • 359
  • 2
  • 7
13
votes
5 answers

Python curve fit library that allows me to assign bounds to parameters

I'd like to be able to perform fits that allows me to fit an arbitrary curve function to data, and allows me to set arbitrary bounds on parameters, for example I want to fit function: f(x) = a1(x-a2)^a3\cdot\exp(-\a4*x^a5) and say: a2 is in…
jb.
  • 23,300
  • 18
  • 98
  • 136
13
votes
5 answers

Insert empty string into INT column for SQL Server

A SAMPLE table has only one column ID of type int, default null. In Oracle when I do: insert into SAMPLE (ID) values (''); the new record is added with blank value. But in SQL Server 2008, when I run the same insert statement, the new record has…
user1793297
  • 131
  • 1
  • 1
  • 4
12
votes
1 answer

How to downcast numeric columns in Pandas?

How to optimize the data frame memory footprint and find the most optimal (minimal) data types dtypes for numeric columns. For example: A B C D 0 1 1000000 1.1 1.111111 1 2 -1000000 2.1 2.111111 >>> df.dtypes A …
Mykola Zotko
  • 15,583
  • 3
  • 71
  • 73
12
votes
2 answers

Create a numeric text box in java Swing with increment and decrement buttons

How can I create a numeric text box in java swing , which has two buttons (up and down) which increments and decrements the value in the text box respectively. Also this text box must be editable with ONLY NUMERIC VALUES. Something like this I…
Balanivash
  • 6,709
  • 9
  • 32
  • 48
12
votes
3 answers

Problem using pair with accumulate

I am using a deque so I can generate rolling averages and variances for my data. I store n and n^2 as a pair in the deque and then use accumulate with my own operator+(). #include #include #include template
DanS
  • 1,677
  • 20
  • 30
12
votes
2 answers

Tracing Python warnings/errors to a line number in numpy and scipy

I am getting the error: Warning: invalid value encountered in log From Python and I believe the error is thrown by numpy (using version 1.5.0). However, since I am calling the "log" function in several places, I'm not sure where the error is…
user248237
12
votes
3 answers

Replace NA with 0, only in numeric columns in data.table

I have a data.table with columns of different data types. My goal is to select only numeric columns and replace NA values within these columns by 0. I am aware that replacing na-values with zero goes like this: DT[is.na(DT)] <- 0 To select only…
HannesZ
  • 599
  • 2
  • 5
  • 17
12
votes
3 answers

R: plot histogram of all columns in a data.frame

I'm a new user in R and I've just started to work with it to see the distribution of my data but I got stuck on this error. I have a data frame and I would like to plot histograms of it's numeric columns. So what I did is as bellow : num_data…
Alex
  • 1,914
  • 6
  • 26
  • 47
12
votes
1 answer

Can the Postgres data type NUMERIC store signed values?

In PostgreSQL, I would like to store signed values -999.9 - 9999.9. Can I use numeric(5.1) for this? Or what type should I use?
Nyi Ma Lay Win Lae Aye
  • 6,250
  • 2
  • 13
  • 10
12
votes
1 answer

correlation error: 'x' must be numeric

I have a XTS dataset that contains many stock closing prices called: dataset. I then wanted to find if their returns have any correlation via cor() , however I get an error message: Error in cor(RETS) : 'x' must be numeric. Here is what i have…
Jason
  • 311
  • 1
  • 4
  • 14
12
votes
3 answers

Converting Character to Numeric without NA Coercion in R

I'm working in R and have a dataframe, dd_2006, with numeric vectors. When I first imported the data, I needed to remove $'s, decimal points, and some blank spaces from 3 of my variables: SumOfCost, SumOfCases, and SumOfUnits. To do that, I used…
idemanalyst
  • 137
  • 1
  • 2
  • 8
12
votes
5 answers

How can I disable scientific notation when working with very large numbers in Perl?

Consider the following: print 3 ** 333; #Yields 7.6098802313206e+158 My question is simple: How can I disable scientific notation when working with very large numbers? Basically, I'd like to see all the digits dumped to stdout verbatim. Is this…
j6a72