Linked Questions

13 votes
2 answers
41k views

I'm doing a program where I optimize some values. Due to the equations, from time to time my values are NaN My problem, some of the entries are NaN. I would like to know if there is a test to check ...
Leon palafox's user avatar
  • 2,785
0 votes
3 answers
1k views

I have a list with mixed data types: Z = ['a','b', float('NaN'), 'd'] I would like to remove the nan observations. I tried the following based on a couple of multiple suggestions but nothing worked: ...
WJA's user avatar
  • 7,054
1 vote
1 answer
7k views

I've got a csv file where some of data is empty. When I use an if statement, the NaN data is included to else statement. def warna_kota(population): if population < 10000: return '...
Hendra Sirait's user avatar
0 votes
2 answers
2k views

I tried to check if a variable is equal to np.nan in the code(4th last line). But somehow I don't get a desired output while doing this rather when I use np.nan with check condition it sort of ignores ...
Inequilazitive's user avatar
0 votes
0 answers
3k views

There is a function in numpy named np.isnan(A) to check whether A is nan. In my case, A could be a number with some unknown value or np.nan returned from another function. I need a function to tell me ...
Wenjie Yu's user avatar
  • 101
1 vote
0 answers
2k views

I have a pandas dataframe converted into a dictionary (OrderedDict) and now I need to look for real NaN values (not the 'nan' string values) without pandas/numpy methods (as it should be independent ...
Antje Janosch's user avatar
0 votes
1 answer
814 views

df = pd.read_csv(r'....movie_metadata.csv') director = df.director_name.tolist() #I kept director names to list movie = df.movie_title.tolist() But problem is director list has some nan values. When ...
stalkerstacker's user avatar
0 votes
2 answers
531 views

how can I delete the keys in a dictionary that has values nan ? with and without creating new dictionary ? example: my_dictionary = dict( first=float("nan"), second="second"...
harveeey's user avatar
1 vote
1 answer
716 views

I used the following syntax if (uf > 0x7f800000) But this is not working. Any help will be appreciated!
Ancient_Bison's user avatar
0 votes
0 answers
598 views

Given that i have a below datadrame: dt = pd.DataFrame({"Cabin" : ["Hello","Morning",np.NAN,"BBC"]}) I wish to apply the following process on the Cabin column: ...
Jeff's user avatar
  • 8,548
1 vote
0 answers
137 views

Let's say I have a pandas dataframe with some nan values. Every time I do something like df["column"] == np.nan, it always returns all False. It never returns True even though there are obvoiusly ...
we_are_all_in_this_together's user avatar
0 votes
0 answers
137 views

So, I have a Pandas dataframe, and wish to iterate upon a column, doing stuff on the NaNs. Issue is: no direct comparison wants to give me a True. Checking the column via isna() and notnull() works ...
Makel's user avatar
  • 23
0 votes
1 answer
67 views

I have a dataframe with columns containing both single NaNs, as well as lists which may contain NaN elements. Example: df = pd.DataFrame({'A': [[1, 2, 3], np.nan, [7, np.nan, np.nan], [4, 5, 6]]}) I ...
silence_of_the_lambdas's user avatar
0 votes
0 answers
62 views

I am running a linregress regression and creating a statistic. Please see the following snippet of code: X = dfMyRoll.ix[1:,'SCORE'] Y = dfMyRoll.ix[1:,'SCORE_LAG'] slope,intercept,_,...
Stacey's user avatar
  • 5,177
0 votes
1 answer
50 views

I have the following date in a dataframe: date1 date2 date3 -------------------------------------------------------- 16/07/2021 13:32 16/07/2021 14:25 26/07/2021 16:...
Lkmuraz's user avatar
  • 141

15 30 50 per page
1
2 3 4 5