Delete Column of pandas DataFrame in Python (3 Examples) | Drop & Remove Variable by Name & Index

preview_player
Показать описание
Python code of this video:

import pandas as pd # Load pandas library

data = pd.DataFrame({"x1":range(3, 9), # Create pandas DataFrame
"x2":[4, 2, 8, 1, 9, 1],
"x3":["a", "b", "a", "c", "b", "b"],
"x4":range(16, 10, - 1)})
print(data) # Print pandas DataFrame

print(data_new1) # Print updated DataFrame

print(data_new2) # Print updated DataFrame

print(data_new3) # Print updated DataFrame

Follow me on Social Media:

Рекомендации по теме