Я пытаюсь создать подзаговоры в пандах определенных графиков и продолжаю получать эту ошибку: аргумент float () должен быть строкой или числом, а не 'AxesSubplot', какие-либо идеи о том, какое исправление можно использовать?
colours = ['#F5DEB3', '#528B8B', '#9E9E9E', '#FFA500']
sex_and_wellbeing = results_redditThread_df.groupby(['pay_for_sex'])[['bodyweight']].apply(lambda x: pd.DataFrame(x['bodyweight'].value_counts()))
sex_and_wellbeing = sex_and_wellbeing.unstack()
graph_sex_and_wellbeing3 = sex_and_wellbeing.plot(kind='bar', figsize=(20, 13), color=colours, rot=0, fontsize=21)
graph_sex_and_wellbeing3.set_title('Number of People who would Pay for Sex based on Bodyweight', fontsize=24)
graph_sex_and_wellbeing3.set_xlabel('Sex payments', fontsize=21)
graph_sex_and_wellbeing3.set_ylabel('Number of People with Certain Weight', fontsize=21)
graph_sex_and_wellbeing3.legend(
['Normal Weight', 'Obese', 'Overweight', 'Underweight'],
loc='best',
ncol=1,
markerscale=1.5,
fontsize=15)
fig, ax = plt.subplots(2)
ax[0].plot(graph_sex_and_wellbeing)
ax[1].plot(graph_sex_and_wellbeing3)
Предварительный просмотр кода здесь