I am doing the data segmentation where I have huge data of 1200 rows and 17 columns. I want to plot the graph for entire data for country and population.
When I am trying to work with below code I am getting an error:
ValueError: could not convert string to float: 'Canada'
The code:
import pandas as pd # for dataframes
import matplotlib.pyplot as plt # for plotting graphs
import seaborn as sns # for plotting graphs
import datetime as dt
data = pd.read_excel("TestData.xls")
plt.figure(1, figsize=(15, 6))
n=0
for x in ['Country', 'Product', 'Sales']:
n += 1
plt.subplot(1,3,n)
plt.subplots_adjust(hspace=0.5, wspace=0.5)
sns.distplot(data[x], bins=20)
plt.title('Displot of {}'.format(x))
plt.show()