I have written this code to perform a histogram from a .csv
file however I do not get the histogram but as you see in the image
how can I fix it?
import matplotlib.pyplot as plt
import pandas as pd
data = pd.read_csv('test.csv', header=None)
plt.hist(data)
plt.show()
The head lines in the .csv
file are:
-95.725
-78.477
-77.976
-77.01
-73.161
-72.505
-71.794
-71.036
-70.653
-70.476
-69.32
-68.787
-68.234
-67.968
-67.742
-67.611
-67.577
-66.69
-66.381
-66.172
-66.072
-65.773
-64.969
-64.897
-64.603
data
afterread_csv
? You get many histograms with 1 entry each, so you probably need to reshapedata
into a pandas.Series or a 1D numpy array.data.head()
to see what you have.