Nickel
Nickel

Reputation: 590

When selecting row based on column value got empty row but column value is available in data frame

here is my piece of code, this is working well for all other values of column but for one value in column giving empty row , but this value is available in column so row should not be empty

EOG_MAX_model=pp.loc[(pp['time']==5.3)]

5.3 is available in 'time'column. and datatype is float64

Upvotes: 1

Views: 17

Answers (1)

jezrael
jezrael

Reputation: 863166

There is problem with precision, possible solution is use numpy.isclose:

EOG_MAX_model=pp.loc[np.isclose(pp['time'], 5.3)]

Upvotes: 2

Related Questions