This report analyzes the fuel consumption data from final.xlsx, focusing on the distribution by Bur_RGPH.
Data Loading
Code
import pandas as pdimport matplotlib.pyplot as pltimport seaborn as sns# Load data# Using engine='openpyxl' to read .xlsx filesdf = pd.read_excel("../final.xlsx", engine='openpyxl')df.head()
# Group by Bur_RGPHgrouped = df.groupby('Bur_RGPH')[['Litre', 'Valeur']].sum().reset_index()grouped = grouped.sort_values('Litre', ascending=False)grouped.head(10)
Bur_RGPH
Litre
Valeur
4
المنستير
7.9410.107.945.057.9410.103.975.055.053.977.94...
67555.20
14
زغوان
40.0040.0040.0020.1540.0010.0720.1531.6040.004...
33838.35
25
نابل 1
31.6819.8050.3739.6050.3719.8039.6019.8050.371...
56287.22
26
نابل 2
27.7239.6011.8839.6039.6039.6039.6039.6039.603...
49958.75
20
قابس
25.1925.1945.8425.1929.7225.1925.1925.1925.192...
64125.00
9
تطاوين
25.1850,3750.3750.3750.3745.3445.3425.3725.375...
46435.00
8
بنزرت
25.1825.1825.1825,1825,1825,1825.1825.1825.182...
96810.00
17
سيدي بوزيد
25.1822.6719.8025.1819.8019.8019.8025.1822.672...
99196.10
23
مدنين
22.6840.0022.6822.6819.8022.6839.6045.3622.683...
127188.15
10
توزر
20202020202020252520204040404028202020202017.0...
19926.55
Visualization
Code
# Plot Top 10 Bureaux by Fuel Consumptionplt.figure(figsize=(10, 6))sns.barplot(data=grouped.head(10), x='Litre', y='Bur_RGPH')plt.title('Top 10 Bureaux by Fuel Consumption (Litres)')plt.xlabel('Total Litres')plt.ylabel('Bureau RGPH')plt.tight_layout()plt.show()
/tmp/ipykernel_52306/632660810.py:7: UserWarning: Tight layout not applied. The left and right margins cannot be made large enough to accommodate all Axes decorations.
plt.tight_layout()