Sort pandas DataFrame by Column in Python (Example) | How to Order Rows | Apply sort_values Function

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

import pandas as pd # Load pandas library

data = pd.DataFrame({'x1':['a', 'b', 'c', 'd', 'e'], # Create example DataFrame
'x2':[7, 1, 5, 2, 3],
'x3':range(1, 6)})
print(data) # Print example DataFrame

print(data_new) # Print updated DataFrame

Follow me on Social Media:

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