2021年3月19日星期五

Why I can't delete the rows in python?

I am trying to delete the rows with missing values in python and the code runs but with no effect whatsoever. The rows are not deleted. I've added also a screenshot of my xls file.

This is how my code looks like:

  df = Pandas.read_excel('C:/Downloads/Report.xls')    engine='python'    new_df = df.dropna(inplace = true)    puts new_df.to_string()  

I've tried also with: new_df = df.dropna(axis=0, how="any", inplace=false) OR new_df = df.dropna()

IT DOES NOT DELETE THE ROWS.

I get the following result: Unnamed: 2 0 asset_number 1 WG0000000000 2 WG0000204381 3 WG0000204381 4 WG0000204381 5 WG0000204379 6 WG0000204379 7 WG0000204379 8 WG0000204366 9 WG0000204366 10 WG0000204366 11 WG0000204368 ...Report.xls

https://stackoverflow.com/questions/66717971/why-i-cant-delete-the-rows-in-python March 20, 2021 at 11:34AM

没有评论:

发表评论