I have written following code to plot histogram from given set of values in csv file column :
import pandas as pd import matplotlib.pyplot as plt import numpy
class createHistogram():
def __init__(self,csv_file):
self.csv_file = csv_file
def load_csv(self):
bin_edge = range(0,100,10)
tp_data = pd.read_csv(self.csv_file)
dataframe = pd.DataFrame(tp_data)['tp']
dataframe.hist(bins=bin_edge)
plt.show()
return tp_data
Here I am getting histogram if values are less than 10, 20 ... and so on, but i want it should be
bin_value<=10
10< bin_value <=20
20
I am new to panda module..