I am trying to visualize various FourSquare venues for a specific set of neighborhoods in Paris from the below data frame but am receiving an error message below. Looking for any suggestions, thank you!
Dataframe:
cluster4_df = paris_neighborhood_venue_counts.loc[(paris_neighborhood_venue_counts['Neighborhood'] == '9eme Ardt') | (paris_neighborhood_venue_counts['Neighborhood'] == '1er Ardt') | (paris_neighborhood_venue_counts['Neighborhood'] == '2eme Ardt') | (paris_neighborhood_venue_counts['Neighborhood'] == '4eme Ardt') | (paris_neighborhood_venue_counts['Neighborhood'] == '5eme Ardt') | (paris_neighborhood_venue_counts['Neighborhood'] == '15eme Ardt') | (paris_neighborhood_venue_counts['Neighborhood'] == '10eme Ardt')]
Displaying the top 15 venues in each Neighborhood:
num_top_venues = 15
for hood in cluster4_df['Neighborhood']:
print("----"+hood+"----")
temp = cluster4_df[paris_neighborhood_venue_counts['Neighborhood'] == hood].T.reset_index()
temp.columns = ['venue','freq']
temp = temp.iloc[1:]
temp['freq'] = temp['freq'].astype(int)
temp = temp.round({'freq': 2})
print(temp.sort_values('freq', ascending=False).reset_index(drop=True).head(num_top_venues))
print('\n')
Stacked Bar Chart Code. This code returns a bar chart but does not ignore 0 values in the histogram.
cluster4_df.dropna()
cluster4_df.plot(kind='bar', figsize=(25, 15), stacked = True)
plt.title('Histogram of Venues in Parisian Arrondissements')
plt.ylabel('Number of Venues')
plt.xlabel('Arrondissement')
plt.show()