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.
2,552
questions
0
votes
0
answers
10
views
How to get exact extremely low P-value in R (on log scale or otherwise)
I am running a linear regression model in R, and the association is very significant- the P-value is much lower than the standard 2.2e-16.
The t-statistic from the regression is -44.85
and the degrees ...
0
votes
0
answers
10
views
How can I improve trigonometric interpolation of function using python?
We have to interpolate f(x) = |x| using DFT and trigonometric interpolation. We have to interpolate the function in [2,4,8,16] nodes which are equidistantly spread apart in [-pi,pi]. My solution does ...
0
votes
0
answers
23
views
Create a matrix with strings and numeric values in memory
I want both string and numeric values in a matrix. I do not want to create a new dataset because in my real code, I have to keep the dataset loaded, so I have to fill this matrix with numeric and ...
-1
votes
0
answers
13
views
Python: how to force string value displayed as integer on PandasTableModel
I working with Python3.
I read my CSV filename (*), with:
to suppress ' ' characere
df = pd.read_csv(filename, sep='|')
to cleanup '--', '-', and if after '--' we have more than 2 digits
df.columns = ...
0
votes
1
answer
29
views
Implementing Integration Limits when using Numerical Integration
I'm using numerical integration to model the trajectory of a particle passing through a non-uniform magnetic field. I'm specifically using a Markov Chain Monte Carlo algorithm (Metropolis-Hastings) ...
0
votes
1
answer
22
views
How to check if a value is within a range of values in Spotfire
I have a set of ranges for specific values, for example I attached a table. ID Ranges to filter out specific IDs The idea of this table is to specify which values are "included" / falls ...
-1
votes
0
answers
14
views
BitLocker Password recovery key [closed]
i did not know what was happening to my system. my bitlocker drive does not open even putting the correct password .i tried different steps like cmd and from microsoft account but nothing happened. my ...
0
votes
0
answers
13
views
Is pd.numeric's invalid parsing for errors="coerce" and errors="ignore" different? [duplicate]
I want to convert strings to floats in a specific column of a DataFrame if possible. The column includes some values such as "-" which can not be converted, but I want to keep such values as ...
0
votes
1
answer
21
views
Something goes wrong calculating the slope of the simulation
In this python code we are trying to simulate the path of a frisbee that is being shot from a shooter with a certain angle (alpha0). The angle of attack should be the angle at which its being shot, ...
0
votes
2
answers
33
views
Converting numeric data to character based on condition in R
I have a numeric data column of months, so I want to convert the column to character type while also changing the values to alphabets.
all_trips %>%
as.character(all_trips$ride_months == 1) <- '...
0
votes
0
answers
46
views
data.table column subsetting returns column names, not columns themselves
I'm processing some of the CES PUMD data and am using functions from the Census Bureau's cepumd package. I got a strange error running their ce_mean() function and was working inside of the source ...
0
votes
0
answers
14
views
Solving 2D Poisson Eq with mixed BC's in Python
I am trying to numerically solve the Poisson's equation
$$
u_{xx} + u_{yy} = - \cos(x) \quad \text{if} - \pi/2 \leq x \leq \pi/2 \quad \text{0 otherwise}
$$
The domain is the rectangle with vertices $...
0
votes
0
answers
14
views
Why does this new column infection_rate all show 0s? [duplicate]
Just as the title says. If I had to guess, I would think maybe it's because the values are too small and they're getting rounded off to 0? But then that wouldn't make sense because with the values ...
1
vote
1
answer
29
views
Error calculating coefficient of variation (or any function with binary operators) with summarise() & across() of dplyr
I'm trying to calculate the mean, sd and coefficient of variation (cv) by tidyverse functions. No problem with mean or sd but with cv -as 100*(sd/mean)- it reports the following error:
Error in `dplyr:...
1
vote
1
answer
34
views
Is there any benefit in restricting a numeric field in Postgres? E.g.: numeric(70,0) instead of numeric
I'm working with large integer numbers, which I currently represent in PG using numeric(x, 0). I don't want to think about x each time, so I'm wondering:
Is there any benefit (storage, performance, ...
0
votes
1
answer
31
views
Why I am getting Empty sym problem while solving the problem?
I want p as a function of x after solving this equation. I am unable to get a satisfoctory answer for this.
I am trying to get p as a function of x in MATLAB...bit, am getting an empty sym problem. ...
1
vote
2
answers
80
views
std::reduce is failing to compile when types of container and initial value differ
I ran into a portability issue with std::reduce().
There's a call to std::reduce() that compiles in Visual Studio, but not with gcc. It's not clear to me from the cpp documentation if the issue is a ...
-3
votes
2
answers
44
views
Why is it not allowed to assign double literal to variable of type float? [duplicate]
In java, the compiler throws an error if you try to assign a double literal to an int variable. However, it allows the assignment of an int literal to variable of type long.
double d = 4.0;
...
0
votes
1
answer
64
views
Bigquery -INSERT INTO
I am getting the following ERROR when attempting this SQL:
INSERT INTO xxxx.Dxxxx.tbl_cluster_data
WITH source1 as (
SELECT string_field_0,string_field_1, double_field_2, double_field_3,...
0
votes
4
answers
43
views
Is it possible to convert the type of a character into numeric while maintaining the character itself?
let's say I have this df
df = data.frame(x = c('1E','1E','2F','2F','3F','3E','4E'),
y = LETTERS[1:7] )
The first column (x) is of type character. I just want to change the type to ...
0
votes
0
answers
24
views
read.csv: some columns are set to zero (should be numeric but are imported as characters) in R [duplicate]
I am trying to import some csv files with field data to combine several csv files into one.
My goal is to have only numeric columns.
Unfortunately, R replaces all the values with "0" for ...
0
votes
0
answers
7
views
Linear Regression on Character and numeric Data Set (Rscript)
If we have a dataset of Non-Numeric and numeric values as shown below, how we can convert the whole dataset into numeric in order to Normalise it and then apply Linear regression on it.
[enter image ...
0
votes
1
answer
54
views
Error in Correlation Matrix: why deleting NA still doesn't work?
I'm trying to make the correlation matrix
Here a sample of the dataset.
> head(matrix)
# A tibble: 6 x 16
# Groups: nquest, nord [6]
nquest nord sex anasc ireg eta staciv studio asnonoc2 ...
0
votes
0
answers
15
views
Singular Value Decomposition, distance from a matrix to the orthogonal projection of a singular vectors onto the matrix
Here, A matrix is a set of 1000 images of a single digit, each image having resolution of 28x28. $P_{W_d}(A)$ is the orthogonal projection of a dictionary W onto A. Here $W_d$ is an array consisting ...
-1
votes
0
answers
18
views
How to measure correlation and do heatmap for a dataset having both categorical and numerical variables. Target is categorical
dataset for sexual violence in Bangladesh
How to measure correlation and get heatmap for such type of dataset having both numerical nad categorical variable? Target is categorical variable. Please ...
0
votes
1
answer
32
views
Sybase SQL: Convert string numeric value with comma as decimal separator to NUMERIC(26, 6)
according to this post:
[https://dba.stackexchange.com/questions/118057/convert-string-numeric-values-with-comma-as-decimal-separator-to-numeric10-2][1]
... the following code should work:
declare @...
1
vote
2
answers
33
views
How can I replace unique vector elements based on order of occurrence?
Let's say that I have this df (but so much bigger)
df = data.frame(x = rep(1:10,each=2) )
I wish this dataframe to become as follows (the objective is that I don't want to replace each value by its ...
-1
votes
1
answer
44
views
How can I find a character of a numeric value in a column of character values that are constructed of numbers and letters?
Let's say I have a dataframe as follows (but much bigger)
df = data.frame(x = c('1E','2E',3,4,5) )
I wish to be able to find the rows numbers that have the characters 3,4 and 5 that do not have ...
0
votes
0
answers
37
views
VBA for excel error of type mismatch error centering around "For k= rangeValues(0) To rangeValues(1)"
Ok, admittedly I am trying this with chatgpt and going in circles. Just trying to solve a work problem, and I am not a programmer. I need to handle data that is numeric and alphanumeric and also in ...
1
vote
1
answer
32
views
outliers detection and removal in a dataset with categorical and numerical variables
I am using the cardiotocography dataset and i have created a dataset of 9 variables and the categorical NSP variable but when i remove the outliers categories 2,3 are deleted in the NSP variable.How ...
2
votes
1
answer
38
views
Are vectors and matrices reference or value types? Math.Net Numerics
Excuse my ignorance, but are vectors and matrices reference or value types? Not sure if that makes a difference, but I am referring to those created from an array?
I tried to look it up online quickly,...
4
votes
1
answer
50
views
Comparing numeric and integer values sometimes gives TRUE and sometimes FALSE
I use %in% to compare two lists, one with a vector of numeric values and the other with corresponding integer values. The result is really weird; sometimes TRUE and sometimes FALSE and I can't figure ...
0
votes
1
answer
31
views
Postgresql 15 - Trailing junk after numeric literal error
After the Postgresql update v15, I realised that even I have a column that accepts UUID data type, it will throw me similar error like this whenever I try to Insert UUID data into the table :
Script :
...
1
vote
1
answer
32
views
Convert string containing roman numerals to numeric using R
I want to convert "stage i", "stage ii", etc to numeric "1" and "2".
pheno_df$pathologic_stage <- gsub("stage ","",pheno_df$...
-1
votes
2
answers
44
views
confuse SQL Server datatype decimal over 15 digit after comma
I have table with structure as follow :
Table1 (
id int NULL,
description varchar(50) null,
rate decimal(18,15) NULL
)
and when I test insert data into the table problem value like this :
...
-1
votes
1
answer
41
views
Can't get value of numeric input if input is greater then 0
<input type="number" placeholder="Number of people*" class="user_number" min="1" max="5">
let user_number = document.getElementsByClassName(&...
0
votes
3
answers
44
views
Parse error in octave while I try to see the output
I wrote a function in octave and got an error like this:
parse error near line 6 of file D:\Evan\Kuliah\Smt 4\METNUM\newton_method.m
syntax error
y = @3*x^2 - 4*x;e
code:
function y = df(x)
y =...
0
votes
0
answers
44
views
excel vba copy / pasting values losing precision
i'm using excel (microsoft 365 - 32-bit) and have a vba macro to open a source workbook, copy a range of cells and paste it to a target workbook ie the workbook containing this macro. The source cells ...
0
votes
1
answer
47
views
Segregate Alphanumeric Characters from a String of Mixed Characters Inside an Excel Cell using VBA code
Function xxx(str As String) As String
Dim strarr() As String
str = Replace(str, ".", " ")
strarr = Split(str)
Dim i As Long
For i = 0 To UBound(strarr)
If strarr(i) Like "[A-...
-3
votes
1
answer
288
views
if the character is a numeric digit, prints its name in text (e.g., if input is 9, output is NINE) [closed]
enter image description here
in the image please see the option c . I need a program in python.
enter image description here
I was trying to print number in word but I didn't get successful. I want a ...
0
votes
0
answers
58
views
why a long numeric value changed after converting the variable from character to numeric?
I concatenated some varibales to create an ID, I created two types of variables concatenated (both with same values), one in a string format and the other in a numeric format. But the result differs ...
-1
votes
4
answers
78
views
Pandas dataframe :convert the numeric value to 2 to power of numeric value
How do i get this 2^ value in another col of a df
i need to calculate 2^ value
is there a easy way to do this
Value
2^Value
0
1
1
2
0
votes
3
answers
35
views
Checking the Input value is Number or not in oracle
I have below procedure having varchar as input parameter
Create or Replace procedure p1(brand_code varchar2)
a varchar2(22);
Begin
SELECT DESCRIPTION into a from UDA_VALUES
WHERE CODE =brand_code;
...
2
votes
4
answers
39
views
Column of mixed strings and numbers - need to conditionally convert strings to numerical format
I have a script that processes data from a CSV file, however sometimes one of the columns I am using from the CSV file randomly has some of its numbers enclosed in string characters thus making it a ...
0
votes
0
answers
23
views
In R scientific use of values (e.g. change 8e-04) [duplicate]
I have a large list of stock values for different companies. The data is currently stored in Excel.
When I upload the data in R, some of the value change, e.g.
in Excel: 0,008
in R: 8e-04
Because of ...
0
votes
0
answers
40
views
Scipy sparse eigenvalue algorithm is not parallelized on Apple Silicon
I sometimes use eigva, eigve = scipy.sparse.linalg.eigsh(M, k=10, which=’SA‘) to find a few of the lowest eigenvalues of a given sparse hermitian matrix on a MacBook Pro with M1 Pro chip, with a conda ...
1
vote
0
answers
19
views
numerical approximation 2D integral
I want to approximate numerically integral in the 2 D rectangular domain.
D = [0, 10] X [0, 10]
enter image description here
I know we can approximate integral with a double sum for x and y. We need ...
0
votes
0
answers
27
views
Is there a R function (or any way) to color code all numeric values within a single string?
`I successfully manage to color code certain words within a string.
However, I am unable to color code ALL numeric values within that same tring.
I want all the numeric values within the string (...
0
votes
2
answers
35
views
R: stable method for transforming selected list columns to numeric
I have a list that looks like:
df1 <- tibble::tribble(~City, ~State, ~Year, ~Temp,
"", "", "Year", "Overall temperature, by now",
"Aberdeen", &...
1
vote
1
answer
22
views
Is there any method to choose one character(certain) and only numeric columns from data.table?
A certain character column(emp_name) and only numeric columns must be selected from a data base. I tried .SDcols function, bu I could not figure out. Here is data.table
emp.data <- data.table(
...