After grouping two columns of data in my dataframe, I obtained a small table of integers whose image I've attached below.
Please click here for the image of the data
This was the code used for grouping:
count = x_train.groupby(['bool_loc', 'target']).size()
I am trying to visualize this data (type int64) using python and thought that maybe a histogram with two categories 0 and 1 (for column 'bool_loc') and each category having two bars (for column 'target') with their heights representing frequency would be a good way to do so. I tried like this:
# create figure and axis
fig, ax = plt.subplots()
# plot histogram
ax.hist(count)
# set title and labels
ax.set_title('Relation Between Location Data Presence and Disaster Tweets')
ax.set_xlabel('Location Data Presence')
ax.set_ylabel('Frequency of Tweets')
The histogram I obtained:
It seems that the frequency data has been plotted along the x-axis (it should be on the y-axis) instead of the data in 'bool_loc'.