zero-one
6
Q:

sort csv file by certain parameter in python

import pandas
csv_file = pandas.read_csv('name of csv' # you can implement options as you want here)
sorted_csv = csv_file.sort_values(by=['Col name here'])
0
#after you assign info result to sortedlist
sortedlist = sorted(reader, key=lambda row: row[3], reverse=True)
0
#importing pandas package 
import pandas as pd 
  
#making data frame from csv file 
data=pd.read_csv("nba.csv") 
  
#sorting data frame by Team, age and height 
data.sort_values(["Team", "Age", "Height"], axis=0, 
                 ascending=[False,True,False], 
inplace=True) 
  
#display 
data 
0

New to Communities?

Join the community