I am getting weird issue while getting output.
can you please advise the issue -
select all rows from
f500 that have a null value for the
previous_rank column. Select only the
rank , and
previous_rank columns. Assign the result to
Actual Output :
Expected output :
I had the same error. It was due to omission of 2. Reading CSV files with Pandas, where
0 are turned into
f500.loc[f500["previous_rank"] == 0, "previous_rank"] = np.nan
Omitting this step leads to:
0 instead of
f500["previous_rank"].isnull() returns nothing
f500[f500["previous_rank"].isnull()] returns an empty DataFrame
Is this also the case in your problem?
Thank You. converting the ‘0’ to NaN solved the problem.
f500.loc[f500[“previous_rank”] == 0, “previous_rank”] = np.nan