Top "Nan" questions

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

Pandas: Impute NaN's

I have an incomplete dataframe, incomplete_df, as below. I want to impute the missing amounts with the average amount …

python pandas nan dataframe mean
Dropping 'nan' with Pearson's r in scipy/pandas

Quick question: Is there a way to use 'dropna' with the Pearson's r function in scipy? I'm using it in …

pandas scipy nan pearson
In Scala, why is NaN not being picked up by pattern matching?

My method is as follows def myMethod(myDouble: Double): Double = myDouble match { case Double.NaN => ... case _ => ... } The IntelliJ …

scala pattern-matching ieee-754 nan
Best way to detect NaN's in OpenGL shaders

I ran into what seemed a mysterious bug this morning that I feel very lucky to have stumbled upon a …

opengl glsl nan
Negative NaN is not a NaN?

While writing some test cases, and some of the tests check for the result of a NaN. I tried using …

c++ nan fast-math
Comparing pandas Series for equality when they contain nan?

My application needs to compare Series instances that sometimes contain nans. That causes ordinary comparison using == to fail, since nan != …

python pandas numpy nan equality-operator
Force gfortran to stop program at first NaN

To debug my application (fortran 90) I want to turn all NaNs to signalling NaN. With default settings my program works …

gcc fortran nan gfortran
Forced conversion of non-numeric numpy arrays with NAN replacement

Consider the array x = np.array(['1', '2', 'a']) Tying to convert to a float array raises an …

python numpy type-conversion nan coercion
Comparing parseInt to NaN in Actionscript 3

The AS3 documentation states that if you pass in a string to parseInt that is not a number it will …

actionscript-3 nan parseint
Take the maximum in absolute value from different columns and filter out NaN Python

This was my try. For example df = pd.DataFrame({'a':[5,0,1,np.nan], 'b':[np.nan,1,4,3], 'c':[-3,-2,0,0]}) df.dropna(…

python pandas max nan absolute-value