I'm working on a small project that i've gotten stuck on. I've used python to take a list of timestamps and heatmap data and separate them by line (always 1-100). I am aware of the max() option, but to the best of my knowledge exhausted google and stack overflow attempting to include the line number and multiple max numbers descending.
Here is a sample of the csv I am working with:
0.00088006474088529383
0.00015301444453664169
0.0001578056486084342
4.8472783963609083e-05
0.00018440120509040085
7.766234473424159e-05
What I would ideally need is a list of the 20 biggest numbers' lines in the csv, for example:
6
4
1
5
3
2
I'm unsure how to start this, but I have experimented with:
with open('heatmap.csv', 'r') as heatnum:
for line in heatnum:
print(max(heatnum))
This unfortunately only gives me the singular max number, I'm unsure where to start receiving descending max numbers up to 20, and how to output line number.