-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcell11.py
More file actions
29 lines (24 loc) · 1.3 KB
/
cell11.py
File metadata and controls
29 lines (24 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Group by type of renewable energy and calculate mean values
grouped_df = df.groupby('Type_of_Renewable_Energy').mean().reset_index()
# Plot installed capacity, energy production, and energy consumption
plt.figure(figsize=(15, 5))
plt.subplot(1, 3, 1)
sns.barplot(x='Type_of_Renewable_Energy', y='Installed_Capacity_MW', data=grouped_df, palette='viridis')
plt.title('Installed Capacity by Type')
plt.xlabel('Type of Renewable Energy')
plt.ylabel('Installed Capacity (MW)')
plt.xticks(ticks=range(7), labels=['Solar', 'Wind', 'Hydroelectric', 'Geothermal', 'Biomass', 'Tidal', 'Wave'])
plt.subplot(1, 3, 2)
sns.barplot(x='Type_of_Renewable_Energy', y='Energy_Production_MWh', data=grouped_df, palette='viridis')
plt.title('Energy Production by Type')
plt.xlabel('Type of Renewable Energy')
plt.ylabel('Energy Production (MWh)')
plt.xticks(ticks=range(7), labels=['Solar', 'Wind', 'Hydroelectric', 'Geothermal', 'Biomass', 'Tidal', 'Wave'])
plt.subplot(1, 3, 3)
sns.barplot(x='Type_of_Renewable_Energy', y='Energy_Consumption_MWh', data=grouped_df, palette='viridis')
plt.title('Energy Consumption by Type')
plt.xlabel('Type of Renewable Energy')
plt.ylabel('Energy Consumption (MWh)')
plt.xticks(ticks=range(7), labels=['Solar', 'Wind', 'Hydroelectric', 'Geothermal', 'Biomass', 'Tidal', 'Wave'])
plt.tight_layout()
plt.show()