1
I have a file. csv and need to make a Sorted by a specific column ('salary' column) and list by the column 'name' the top 10 salaries without using PANDAS. Can you help me? Thanks in advance.
lista_top_ten = {}
reader = csv.DictReader(arquivo.csv)
for linha in reader:
for chave, valor in linha.items():
try:
lista_top_ten[chave].append(valor)
except KeyError:
lista_top_ten[chave] = [valor]
sort_top_ten = sorted( reader, reverse=True, key=operator.itemgetter('salario'))