Questions tagged [nan]

NaN is an abbreviation for "Not a Number". NaN is sometimes not equal to itself.

NaN (Not a Number) is a value of the numeric data type representing an undefined or unrepresentable value, especially in floating-point calculations. Systematic use of NaNs was introduced by the IEEE 754 floating-point standard in 1985, along with the representation of other non-finite quantities such as infinity.

A common feature of NaN in many programming languages is that NaN is not equal to itself.

4290 questions
1
vote
0 answers

NansException, Pytorch, Vram and Memory : A Stable Diffusion fairy tale

I started Stable Diffusion with EasyDiffusion. Nice tool, but not enough for my needs. Automatic1111's WebUI got my attention quickly, and then here I am. Started using it a bit, and it works perfectly for simple gens. Although, I'd like to…
Shalvus
  • 15
  • 6
1
vote
3 answers

Falsy? How does the && operator cause a 0 to return 0 rather than NaN?

I read that sometimes the && operator is used to "short circuit" JavaScript into believing that a return value of 0 is 0 and not NaN because 0 is a falsy number in JavaScript. I've been looking around to figure out what all this means. Can someone…
1
vote
1 answer

empty cells are showing .Text as "NaN" using NPPlus in C#

Our client gives Excel files as input and we rip the text out to do stuff with. Whatever they've done is causing some cells to have the .Text property of NaN, but show as blank when viewed through Excel itself. My helper class does a very simple…
The Lemon
  • 1,211
  • 15
  • 26
1
vote
1 answer

How to delete the DataFrame rows with the largest number of NaNs?

Pandas and other question/answers in this site provide solutions for the case when we know the number of non NaN to preserve. How can I efficiently delete just the worst row, or rows if there are more than one being the worst ones. Some examples…
dawid
  • 663
  • 6
  • 12
1
vote
0 answers

Why is the loss becoming NaN during training in my Keras model?

I am training a Keras model with complex input data using the CVNN library. However, during training, the loss becomes NaN after the first epoch. Here is the relevant code: import cvnn.layers as complex_layers def createSB_cart(inp_shape,…
1
vote
2 answers

parseInt returns NaN for normal-looking numeric strings. Why?

So I have the JSON below, as an example: [{"x":"‭12‬","y":"‭−‭67‬‬"},{"x":"‭12‬","y":"‭−‭68‬‬"},{"x":"‭13‬","y":"‭−‭70‬‬"}] After I parse it into an object, using JSON.parse, I end up with an array of objects. So far so good. But when I try to…
fduayer
  • 770
  • 1
  • 7
  • 23
1
vote
0 answers

Why am I getting NaN returned from the categorical_crossentropy which causes an index error when using pyGAD for optimizing a keras ANN parameters?

I've been trying to implement a GA to optimize the parameters of my ANN. I'm new to both of these libraries and I've used this as help to implement it https://blog.paperspace.com/train-keras-models-using-genetic-algorithm-with-pygad/. I'm…
Illuminy
  • 11
  • 1
1
vote
2 answers

Lines return "NaNs" when within a switch; some of these same lines operate flawlessly when the switch is commented out

When I run my program (using gcc -std=c99 -lm) with a switch statement, all of the "factors" calculated in this Case 1: factors[rows][0]=cbrtf((3+(float)scores[rows][1])/(3+(float)scores[rows][3])); are reported as "NaN". If I comment out Cases 2…
1
vote
1 answer

Converting all into nan in pandas dataframe - python

I have a pandas dataframe with floats and strings and few and nan. I am trying to locate all the and convert them into nan using the following function pd.to_numeric(....., errors='coerce'). Also making sure that floats and strings remain…
Telis
  • 311
  • 1
  • 9
1
vote
2 answers

Pyspark: Data frame has a salary column with float type and some NaN values, while filtering out salaries NaN values also coming in the final output

Using the filter method on the salary column, I got the NaN values; as far as I know, NaN values should not be coming in the output data frame. I also asked from ChatGPT, and it shows me without NaN values. When asking for the output difference, it…
1
vote
1 answer

fillna not working in pandas for a specific column

i asigned TEMPERATURE column of NaN value to be zero but not working properly all other columns working properly but this is not senter image description here expecting to be temperature column nan values to be 0 but not working enter image…
1
vote
1 answer

How to only remove rows with NaN that are not at the beginning or end of the pandas Dataframe column?

I have a pandas dataframe. It has a particular column which may or may not contain a continuous set of values as NaN's in its starting and ending. Also, it may or may not contain NaN's intermittently in between as well. My objective is to eliminate…
EnigmAI
  • 157
  • 1
  • 9
1
vote
1 answer

Select not NaN values of each row in pandas dataframe

I would like to get the not NaN values of each row and also to keep it as NaN if that row has only NaNs. DF = a b c NaN NaN ghi NaN def NaN NaN NaN NaN abc NaN NaN NaN NaN NaN The result should be like…
1
vote
1 answer

Why are the results of `turbn` and `turb2n` `NaN` in TraMineR `seqindic` function for every single sequence of the data?

I am using TraMineR package to analyze sequence data. I have a large dataset of sequences, and I am trying to calculate the normalized turbulence using the seqindic() function in TraMineR. However, when I run seqindic() on my data, the results of…
1
vote
0 answers

How to print std::numeric_limits::signaling_NaN() without FE_INVALID being set

I find it useful to check fetestexcept(FE_INVALID). However, just printing the value std::numeric_limits::signaling_NaN() (e.g., with std::cout) seems to set this flag, whereas I only want the flag to be set if the NaN is used in a floating…
jhourback
  • 4,381
  • 4
  • 26
  • 31