How to Remove a Row From a Data Frame in Pandas (Python)

preview_player
Показать описание
This video shows how to delete rows Data Frames in the Pandas library for Python.

If you find this video useful, like, share and subscribe to support the channel!

Code used in this Python Code Clip:

import pandas as pd

axis = 0) # 0 for rows

# Delete rows by index

axis = 0) # 0 for rows

* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .

Рекомендации по теме
Комментарии
Автор

I was having the problem to remove/drop empty row from a dataframe in pandas. I searched in the web and tried their methods including the df.drop, df.dropna, etc. However, they did not work. Until I watched this video, it gave me a surprise. The code works. Thank you very much.

qeiogfw
Автор

what happens when we try to save that particular data

rajarshibiswas
Автор

How about, if i have some rows present in dataframe2 and i want to delete the rows from dataframe1 which is present in dataframe2? Can this be possible

masterbaitt
Автор

I have a problem when i do this:

When i for example delete row 60, i will then get a dataframe that goes from row 59 to 61.

How do i fix this?

blobberv