I've created a very basic dataframe, but as I'm a newbie I'm struggling with creating a bar plot using the matplotlib.pyplot library.
Here is the dataframe:
d = {'Movies' : pd.Series([3560, 12354], index = ['Netflix', 'Prime Video']),
'Shows' : pd.Series([1925, 2132], index = ['Netflix', 'Prime Video'])
}
df = pd.DataFrame(d)
df
Is it possible to have 'Streaming Service' on the x-axis (ie Netflix and Prime Video) and 'Number' on the y-axis (with different coloured bars for movies vs shows)?
This is as simple as df.plot.bar()
:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.