The above dataframe contains survey results where people rated their movie genres from 1 to 5. I want to plot a bar chart which shows how many males and females liked each movie genre. I used the following code.
req_data = req_data[['Movies', 'Horror', 'Thriller', 'Comedy', 'Romantic', 'Sci-fi', 'War', 'Fantasy/Fairy tales',
'Animated','Documentary', 'Western', 'Action', 'History','Age', 'Gender']].dropna()
movie = req_data.loc[(req_data['Movies'] >= 3) & (req_data['Gender'])].copy()
movie = movie[['Movies','Gender']]
movie_data = movie['Gender'].value_counts().to_frame()
movie_data = movie_data.reset_index()
movie_data.columns=['Gender','counts']
horror = req_data.loc[(req_data['Horror'] >= 3) & (req_data['Gender'])].copy()
horror = horror[['Horror','Gender']]
horror_data = horror['Gender'].value_counts().to_frame()
horror_data = horror_data.reset_index()
horror_data.columns=['Gender','counts']
movie_data.plot(x='Gender', y= 'counts',kind = 'bar')
horror_data.plot(x='Gender', y='counts',kind = 'bar')
plt.show()
When use this code I can only get chart of one genre(in this case, chart of 'movie' ). How can I get a chart which shows every movie genre in one?
[In the above code I used >=3 to obtain respondents who liked movies]