I am trying to plot a frequency distribution of data loaded into Jupyter notebook from a csv file in my AWS S3 bucket.
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
bucket = "a_bucket"
data_key = "ice_freq.csv"
data = f's3://{bucket}/{data_key}'
load = pd.DataFrame(pd.read_csv(data))
load
The dataframe displays fine and all data loads as expected. There are 373909 lines of data and only one column titled Data which contains floats rainging from -7.80 to 4.5.
I then use the following to count the occurrences of each float and plot them to a bar chart.
fig, ax = plt.subplots()
r = load['Data'].value_counts()
r.plot(ax=ax, kind ='bar')
(Note that the value counts if run separately looks like this (Value counts output)
However the bar chart I get can be seen in the following link. Faulty Bar Chart and clearly doesn't display correctly (all the x value look like they have been redacted for some reason). Its also not close to being the correct distribution for the data.
Its odd because if I edit 'bar' to 'line' in the code I get a line graph (Line Chart) that I know is the perfect distribution for the data. So I can see the distribution for the data using the 'line' chart. Why isn't matplotlib capable of plotting the bar chart.