I have an ascii file as following
1 306.0416667
2 286.1666667
3 207.5
4 226.4166667
5 304.2083333
6 336.1666667
7 255.5416667
8 224.5833333
9 190.1666667
10 163.5
11 231.125
12 167.3333333
13 193.5416667
14 165
15 166
16 172.173913
17 158.9166667
18 196.8333333
19 154.875
20 303.4166667
I want to found the most frequent group of values. The groups are 0-90, 90-180, 180-270, 270-360.
I tried to use .value_counts() but with no success (even though without grouping the values).
import pandas as pd
col_names=['id','val']
df = pd.read_csv(i,names=col_names,header=None)
df['val'].value_counts().[:1].index.tolist()
np.histogram(): numpy.org/doc/stable/reference/generated/numpy.histogram.html