Python Pandas Tutorial | Drop Rows and Columns of a Pandas Dataset - P1

preview_player
Показать описание
Python Pandas Tutorial | Drop Rows and Columns of a Pandas Dataset - P1
Topics to be covered:
1. Dropping a Single Column of a dataset.
2. Dropping multiple Column of a dataset.
3. Dropping the Column of a dataset based on the Column Index.
4. Dropping the Multiple Column of a dataset based on the Column Index.

import pandas as pd
import numpy as np

1 Dropping a Single Column of a dataset based on the column name

2.Dropping multiple Column of a dataset based on the column name

3. Dropping the Column of a dataset based on the Column Index

4. Dropping the Multiple Column of a dataset based on the Column Index

5. Deleting rows of a dataset and copying the resultant dataset to a new dataframe

# 6. Drop the Duplicate Values based on some conditions
df3 = df3[df3['Embarked'] != 'S'].head()

print(Dup)

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

The topics you have covered in these Pandas series is really apt with regard to Data Preprocessing for Machine Learning. A big opportunity to upskill and ease the audience into Machine Learning thereafter. Thank you again.

ijeffking
Автор

While removing two columns together using index, why we had to use square braces twice. columns[[1, 3]]. I always get a bit confused on usage of braces.

shubhamagrawal
Автор

Hi, Could you please tell that after doing df1= dataset.drop('Name', axis=1) ; what will be the output if we give command - print(dataset.head()) ?

Also, as you have given in row 27, df1 = df1.drop(['Pclass', 'Cabin'], axis=1)
cant we give dataset=dataset.drop('Name', axis=1) in row 22 ??

renubhandari
welcome to shbcf.ru