Created
January 12, 2021 19:26
-
-
Save bh1995/a72440f5b0df9061e49319c2aee09541 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plot nr listings for top 30 cities | |
list_small = listing_total.limit(30).toPandas() # Convert to pandas dataframe | |
num = len(list_small)*4 | |
c = [i for i in range(0,num,4)] | |
plt.figure(figsize=(10,4)) | |
plt.bar(c, list_small['total_listing'],width=3, align='center', alpha=0.5) | |
plt.xticks(c,list_small['city'],rotation=90) | |
plt.ylabel('total listing') | |
plt.xlabel('city') | |
plt.title('The total listings in top 30 cities') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment