I've got a long list of numbers in a one-column csv file, and I am running the following code (the backbone of which was kindly offered by @jpp) to generate a ranked list of the most frequent occurrences in the list:
import csv
from collections import Counter
from itertools import chain
from io import StringIO
import numpy
with open('origList.csv', 'r') as infile:
# define lazy reader object
reader = csv.reader(open('origList.csv', 'r'))
# flatten, convert to int, feed to Counter object
c = Counter(map(int, chain.from_iterable(reader)))
# calculate 2000 most common items, return number and counts
print('\n'.c.most_common(2000))
numpy.savetxt("topRankers.csv", c.most_common(2000), delimiter=",")
But the cv output file (TopRankers.csv) has the actual numbers written in scientific notation instead of decimal and I need the latter (example of the first couple rows below). Any ideas on how I can make this happen? Many thanks in advance.
2.204781298301920000e+08,1.700000000000000000e+01
4.641279012832990000e+09,1.700000000000000000e+01
8.001912089290390840e+17,1.500000000000000000e+01