Reputation: 21
so i have this code
df.plot(kind="bar", x="Countries", y=["2014","2015","2016","2017","2018","2019"], figsize=(50,5), stacked= True, title="Persentase populasi yang terjangkau jaringan seluler")
if i want to limit the number of the country displayed, for example, the first 20 countries. How to do it?
Upvotes: 0
Views: 23
Reputation: 1174
df.iloc[:20].plot(kind="bar", x="Countries", y=["2014","2015","2016","2017","2018","2019"], figsize=(50,5), stacked= True, title="Persentase populasi yang terjangkau jaringan seluler")
With df.iloc[:20]
you select first 20 rows from your DataFrame.
Upvotes: 1