Empleador activo
1 Programming, I chosen python. How to get top ten data (from last column) from comma separated flat file
Anónimo
abc.csv - CSV file name import pandas as pd df = pd.read_csv('abc.csv') df.iloc[:,-1].head(10)
Could I know what do you mean by "from last column" here? Thanks
unix: awk -F',' '{print $NF}' test.csv |sort -r -n |head Python: f = open(r"test.csv", "r") res=[] for i in f: res.append(int(i.split(',')[-1].split('\n')[0])) print(sorted(res,reverse=True)[:10])
Huh, I got it cat file | awk -F',' '{print $NF}' | sort | head -n 10
Sigue a tus empresas favoritas para estar al tanto de las últimas oportunidades y disponer de información desde adentro.
Recibe recomendaciones y actualizaciones personalizadas al iniciar tu búsqueda.