Best Answer · By JanBask Data Science Expert
Answered on Feb 26, 2021
You can use the Pandas function to get the list of columns that had NaN
pd.isnull(train_data).sum() > 0
After handling the new Nan the code will work fine and give the result:
input contains nan, infinity or a value too large for dtype('float64')
Result
portfolio_id False
desk_id False
office_id False
pf_category False
start_date False
sold True
country_code False
euribor_rate False
currency False
libor_rate True
bought True
creation_date False
indicator_code False
sell_date False
type False
hedge_value False
status False
return False
dtype: bool
If You want to learn data science with python visit this data science online course.