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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
77 views

Does the same error guarantee of Java's Math.exp also apply to StrictMath.exp?

In Java, I need to compute (int)Math.exp(x) in a platform independent way. To achieve platform independency, I have to use StrictMath instead: (int)StrictMath.exp(x). Unfortunately, my measurements ...
otmar's user avatar
  • 398
-1 votes
0 answers
19 views

unable to open a file (Unix executable file) containing containing data saved from Scilab [closed]

I've couple of files saved from Scilab containing data and heavy calculation (done with a super calculator). Mac shows the file as Unix executable file. I used to use 'Load' on scilab to open the file ...
Dhamad's user avatar
  • 1
10 votes
3 answers
341 views

tan(x) approximation to double precision on |x| < pi/4

I want to approximate tan(x) quickly to within 1 ULP on the range -pi/4 to pi/4. I have found a solution that is almost good enough but the last factor of two eludes me even with considerable ...
Martin Brown's user avatar
0 votes
1 answer
66 views

What's the real limit for NUMBER data type in Oracle?

I need help with understanding NUMBER data type, because 2 below statements from Oracle documentation seems to be for me mutually exclusive. "The NUMBER data type stores zero as well as positive ...
drk's user avatar
  • 25
2 votes
0 answers
23 views

In maxima I want to see the numeric value of ln(3) but all it says is ln(3) [closed]

There are a number of situations in Maxima where I just can not persuade it to give me a numeric value, as illustrated here: (%i12) e^1; (%o12) e (%i13) ln(3); (%o13) ln(3) I know that e^1 is e and ...
Jim Sykes's user avatar
-1 votes
0 answers
19 views

Python Error: No numeric data when plotting

I want to plot a bar graph by weekday and hours. When I restric the data it shows me this message: TypeError: no numeric data to plot My code works just fine for the overall dataset. However, it does ...
Nuno Can's user avatar
0 votes
1 answer
86 views

How do I pass a variable/parameter to big.NewInt()

The following code snippet is failing to compile on N := big.NewInt(n) with the following error: cannot use n (variable of type int) as int64 value in argument to big.NewInt func Factorial(n int) *...
Cade Bryant's user avatar
0 votes
0 answers
13 views

Simulation of flow around a cylinder in OpenFOAM

Geometry I have a made a geometry to simulate the flow around a cylinder using FreeCAD and exported it as .stl file. I am confused how to proceed next? I am using pitzDaily case directory for this ...
Martin Mathew's user avatar
0 votes
0 answers
26 views

Python keyboard to send int to TextField that only accepts numbers

I'm developing a Python GUI to automate repetitive tasks. Within my firm's CRM app, I need to search for a number of clients and check whether they have updated certain information. I'm encountering ...
gabribaba's user avatar
0 votes
0 answers
34 views

dplyr filter returning 0 results when selecting a number from numerical variable [duplicate]

My data contains a numerical variable (containing numerous significant digits) and I want to select only the values of 6. I assume there is a problem when using the == function and the number ...
Richard Johansen's user avatar
0 votes
1 answer
101 views

Allow more digit after the first 0 with live input validation regex

I have a regex for some verification on my end. It is ^(?![.,])-?[1-9]*?0?[,.]?([,.]\d+)?$ This regex basically validates a number if it starts with 0, a comma or dot must follow Valid => 0.12 ...
nuhkoca's user avatar
  • 1,833
5 votes
10 answers
251 views

Prepend leading zeros to each line of a file

I have a file that looks like this: 1:line1 14:line2 135:line3 15:line4 I need to prepend leading zeros to each line to make it look like this: 00001:line1 00014:line2 00135:line3 00015:line4 Is ...
Monkey05connor's user avatar
2 votes
1 answer
165 views

Why can't u32 add or subtract i32? [closed]

let a: u32 = 10; let b: i32 = 100; let c = a - b; Even this simple operation doesn't work. u32 just can't operate with i32. But I really wonder what's the design principle behind this. I don't think ...
Kodra's user avatar
  • 149
0 votes
0 answers
18 views

Lambdify doesnt work because of backslash in mathematical symbols

I have an impedance controller kinematics, I want to make a simulation in python, but the lambdify function unfortunatelly doesnt work and gives the following error: SyntaxError: unexpected character ...
Vitya's user avatar
  • 1
-1 votes
1 answer
67 views

Is it possible to convert a column contain numeric and character into numeric in R arrow?

For example, if I run the following code: library(arrow) library(tidyverse) mtcars$cyl[2:5] = 'a' mtcars %>% arrow_table() %>% mutate(cyl = cast(cyl, numeric())) %>% collect() An ...
doraemon's user avatar
  • 675
0 votes
2 answers
39 views

numeric column operation in r with condition from another factor level

Given the dataset df df<-structure(list(status = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), levels = c("healthy", "rotten"...
Rudy Benetti's user avatar
1 vote
1 answer
46 views

how to validate readLines() input as numeric vs. character in R

I am coercing a input from readLines() which I understand will take any input, character or numeric, and capture it as a character value. I then want to convert the input to a numeric value using as....
alejandro_hagan's user avatar
1 vote
1 answer
105 views

Qpython: Any way to switch keyboards to a Numeric Keyboard?

Sometimes when using various apps on my Samsung Note Android phone the normal keyboard gets replaced by a numeric keyboard when strictly numeric input is required. I assume that this is built in to ...
bleahy's user avatar
  • 123
1 vote
1 answer
33 views

How to filter reaction times differently for each subject in R

I want to filter reaction times (RTs), discarding RTs greater than 3 SDs from the mean for each subject. I used the function aggregate to have mean and sd for each participant aggregate(DB$rt, list(DB$...
CG96's user avatar
  • 13
0 votes
0 answers
18 views

data_edit from DataEditR is converting numerics to integers

I've come across what seems like a pretty cool package for interactively manipulating dataframes in R, but I've run into a rather annoying quirk in the code. My code supplies the first line, and users ...
kyurii's user avatar
  • 3
0 votes
0 answers
32 views

Is it possible to transform a whole number array (positive and negative) and a sum of a subset to a natural number (positive only) array and sum

From my understanding, if I want to create a natural number (positive only) representation of a whole number (positive and negative) array, it is quite straight forward... take the absolute value of ...
Talon Van Vuuren's user avatar
0 votes
0 answers
15 views

Statistical Function to Use To Understand Significant Differences - Categorical Variable & Two Numeric

I am trying to test if there is a significant difference between patient volume and whether they are interested in "PopHealth" feature or not. The PopHealthInterested column is # of ...
Christine Brydges's user avatar
0 votes
0 answers
33 views

Numerical noise in numpy when recovering the phase shifts of a sinewave

When using the code snippet below, I expect the value of displacement_sim to almost exactly equal displacement however there seems to be a significant amount of numerical noise. import numpy as np ...
dHubley's user avatar
  • 35
0 votes
0 answers
86 views

Error in diversity: input data must be numeric

I just wanted to calculate the "ENS" and add it into another split via pp_wide_count_nlwkn$ENS<-diversity(pp_wide_count_nlwkn[,4:last.spec.col], "invsimpson" dput(...
lxrnax's user avatar
  • 9
2 votes
1 answer
72 views

MATLAB gives more precision than expected when approximating pi

I am using 2021b. I wanted to look at the convergence rate of a iteration algorithm for Pi, using continued fraction. The formula was for wikipedia https://en.wikipedia.org/wiki/Pi#Continued_fractions....
N.Li's user avatar
  • 47
0 votes
2 answers
26 views

How to read a null cell in excel as numeric zero value using xlrd in Python

I'm importing values from different cells and appending them in a column from 50 excel's sheets (timeserie). I need to add them up when reading them, as I just need the aggregated values. But when the ...
MariaJoseMunozRojas's user avatar
0 votes
0 answers
33 views

Troubleshooting foreach/dopar in R with error in larger model function but not in foreach loop

I am working on parallelizing a meta-population (disease) model using foreach and doParallel. In short, I'm trying to run the same process for each meta-population in parallel (there are ~ 2000 ...
rratnaya's user avatar
0 votes
1 answer
48 views

SLOW conversion of strings to floats in Python - ways to speed this up?

Summary of Problem I have a data set supplied to me which has geographic coordinates provided as strings with leading spaces and spaces between the positive/negative signs and the numbers. The data ...
brosenheim's user avatar
0 votes
0 answers
35 views

I want to define two different regions with different properties, however, the following error is coming and I don't know how can I sort it out

import numpy as np import ComPASS from ComPASS.utils.units import * from ComPASS.utils.grid import grid_center from scipy.interpolate import griddata #Set Output information ComPASS....
Afshin Davarpanah's user avatar
0 votes
1 answer
60 views

python dataframe automatically convert numeric columns as float but don't drop non-numeric

I have created the following function to take a data frame, convert numeric columns d-type to numeric. This is doing good job but the problem is, it drops the non-numeric columns as well, which I don'...
Mainland's user avatar
  • 4,272
0 votes
0 answers
37 views

Numeric values not displaying in web page, even though available in server response in jQuery AJAX

I am working on a web application that retrieves data from a server using jQuery's $.ajax() method and displays the data on a web page. The data includes several numeric values. The values are ...
jessiepinkman's user avatar
0 votes
1 answer
45 views

How to produce a color plot with numerical data in Python?

I have whrite two codes. Both are intended to find the value of a certain complex variable omega. The first one is symbolic. I had a symbolic equation in omega that generates the quantity res (the ...
Projetos Programação's user avatar
1 vote
1 answer
153 views

Excel scientific notation converting numeric value to E+ characters

Excel scientific notation converting numeric value to E+ characters. How to handle this in excel parcing in c#? im expecting it as string value.for example my input is '123456789012345678901234567890' ...
Vidya R's user avatar
  • 57
1 vote
2 answers
64 views

PHP - Calculate Array with Non Numeric Value

From mycsv.csv $data[7] has these: 4294967296/4294967296 4294967296 8589934592/8589934592 I want to calculate and put GB, so they become like this: 4GB/4GB 4GB 8GB/8GB What I did: <?php ...
Pekzz's user avatar
  • 67
1 vote
0 answers
16 views

Error x = atomic and x = non numeric while computing linear model and histograms what does that mean?

I get the error that my vector is non numeric while it is: fitmodel <-lm(formula=adg_tot ~ behandeling*week + blok, data=data_adfi_adg_fcr_weekinone) tab_model(fitmodel) summary(fitmodel) anova(...
Kristel's user avatar
  • 21
1 vote
2 answers
57 views

defining a multivariate gaussian initial condition in FiPy

I'm trying to use a multivariate gaussian initial condition for a Fipy integration. I'm currently using the following code: from fipy import CellVariable, Grid2D, Viewer from scipy.stats import ...
alxg's user avatar
  • 368
1 vote
3 answers
65 views

Is there a Python code in SPSS to RECODE a specific value in all numeric questions?

I am working in SPSS and I need to create syntax to recode all numeric variables but only in case of a specific value of another value. For all numeric variables I need to recode the value 50 to ...
La180923's user avatar
2 votes
0 answers
148 views

Error estimating DCC-GARCH using rmgarch in python

I have a dataframe consisting of log-returns for 5 assets, with no missing values etc. I am trying to estimate the DCC-GARCH(1,1) model using rmgarch in jupyter notebook. I already installed/imported ...
BKS's user avatar
  • 21
0 votes
0 answers
96 views

Converting sympy symbolic solve to numeric solve

The answer given in my previous question about sympy's symbolic and numeric solving was very helpful and optimised the code a lot. I want to use this example to convert another part of code: The ...
Tim Moore's user avatar
0 votes
0 answers
36 views

I have a problem with the surv() function

I have two variables, V006 and V008, where V006 is time and V008 indicates whether or not an event occurs. I understand that the Surv() function requires the values of V008 to be 0s (censored) or 1s (...
Joel Alexis Pizarro Muñoz's user avatar
0 votes
0 answers
26 views

Numeric field validation not working in Mac safari

I have created input field and for validation I have put regex as "^[0-9]+$". It is validating for every device but when it comes it mac safari it is accepting every character number and ...
Lija's user avatar
  • 1
0 votes
0 answers
25 views

how to convert multiple 'tags' into numerical value

Suppose I have this table of movies with several ratings including mine. I want to use (let's say) a random forest on that table to teach the machine which movies could be good for me. Now, for each ...
ste's user avatar
  • 1
0 votes
1 answer
209 views

NA values in R when trying to convert to as.numeric

I am trying to convert a column of characters into a column of numeric values. They are already numbers but R recognizes them as characters. Every time i do this, the negative values become NAs. I am ...
Maia Cook's user avatar
0 votes
0 answers
41 views

18 digit field truncating

i have an account number that is 18 digits - when i try to extract the field to CSV it truncates the number (zeroing out last digits) how can i format this field so it doesnt truncate? what i ...
Mkhomiak2's user avatar
0 votes
1 answer
81 views

Converting alphanumeric values to numeric values in a Python pandas dataframe

Timestamp CAN ID Byte DATA[0] DATA[1] DATA[2] DATA[3] DATA[4] \ 1693260 1.478200e+09 0000 8.0 00 00 00 00 00 732574 1.478199e+09 0000 8.0 00 00 ...
Miracle Messiri's user avatar
0 votes
1 answer
57 views

Efficient way to change the class of several matrices in R

I have several matrices and I would like to apply something like class(matrix) <- "numeric" to all of them at once, i.e. the class of all matrices should be changed to numeric. Do you ...
user avatar
0 votes
0 answers
29 views

How to adjust reference date to convert a date to numeric to get the intercept shown in plot

I want to know if I can change the calculation of the number of seconds that have passed between 01/01/2012 and 01/01/2011 and not from 01/01/1970. Is there a possibility to change it? The problem is ...
Jesús Asdrúbal Molina Víquez's user avatar
0 votes
1 answer
111 views

How to correctly use Odeint library for solving ODEs in C++?

I am trying to integrate odeint for a physics simulation. I build a model containing all parameters for my equation: (model.h) #include <vector> #include <boost/array.hpp> #include <...
Daniel R's user avatar
0 votes
1 answer
67 views

Numerics BigInteger.Remainder (Mod) doesn't work with negative divisors

Consider the following equations: 10 % 3 = 1 10 % -3 = -2 10001 % 30 = 11 10001 % -30 = -19 C#'s System.Numerics.BigInteger Seems to produce positive results for negative divisors, as if ...
Matthew Layton's user avatar
0 votes
1 answer
53 views

Accurate evaluation of function for negative x

Is there a way to accurately evaluate f(x) as given below for moderate negative x (around -1e6 to -1e2), while sticking with float64 numbers? def f(x): return 0.5 + arctan(x/sqrt(3)) / pi + sqrt(3)...
hbwales's user avatar
  • 193

1
2 3 4 5
53