I have a Dataframe, i need to drop the rows which has all the values as NaN.
ID Age Gender
601 21 M
501 NaN F
NaN NaN NaN
The resulting data frame should look like.
Id Age Gender
601 21 M
501 NaN F
I used df.drop(axis = 0), this will delete the rows if there is even one NaN value in row. Is there a way to do as required?
inplaceis not recommended and will actually be removed in future versions: https://github.com/pandas-dev/pandas/issues/16529 – tdy Feb 03 '23 at 22:51inplacewas not deprecated. – Leevo Feb 25 '23 at 10:53inplacehas not been deprecated. – mp252 Nov 22 '23 at 15:34inplacehas been inadvisable since 2017, but it won't start being "deprecated" (formally in the API) until the PDEP-8 proposal gets merged. – tdy Nov 23 '23 at 01:41