Generation

generate functionSat, 25 Feb 2023

x1 = (round(g1['rate_group'].value_counts() / g1['rate_group'].value_counts().sum() * 100, 2)) x2 = (round(g2['rate_group'].value_counts() / g2['rate_group'].value_counts().sum() * 100, 2)) x1.plot(kind='hist', alpha=0.5, bins=6, density=True) x2.plot(kind='hist', alpha=0.5, bins=6, density=True) plt.legend(loc='upper left') plt.title('Сравнение распределений с собственным жильем и без') Add to the code above the caption of the legends on the chart: - for x1 = 'x1' - for x2 = 'x2'

def my_function(x1, x2): plt.legend(loc='upper left') plt.title('Сравнение распределений с собственным жильем и без') x1.plot(kind='hist', alpha=0.5, bins=6, density=True) x2.plot(kind='hist', alpha=0.5, bins=6, density=True) return x1, x2 my_function(x1, x2)

Questions about programming?Chat with your personal AI assistant