andre non ci sta più capendo un cabbo

This commit is contained in:
2025-06-23 12:13:20 +02:00
parent 570a1eea81
commit e410ab053b

View File

@@ -54,17 +54,18 @@ print("Valore massimo:",max(result_ac_energies_to_csv_df.gen_pv_100_kWp)) # prin
print("Somma totale:",sum(result_ac_energies_to_csv_df.gen_pv_100_kWp)) # print the total sum of the generated energy
result_ac_energies_to_csv_df.to_csv(path_export, encoding='utf-8')
# GENERAZIONE GRAFICO
import plotly.express as px
# Supponendo che la colonna di interesse sia 'gen_pv_100_kWp'
fig = px.line(
result_ac_energies_to_csv_df,
x=result_ac_energies_to_csv_df.index,
def generate_grafico_torri_df(dataframe, graphTitle):
# GENERAZIONE GRAFICO
import plotly.express as px
# Supponendo che la colonna di interesse sia 'gen_pv_100_kWp'
fig = px.line(
dataframe,
x=dataframe.index,
y='gen_pv_100_kWp',
title='Produttività Fotovoltaica nel Tempo',
title=graphTitle,
labels={'gen_pv_100_kWp': 'Energia [kWh]', 'index': 'Data/Ora'}
)
fig.show()
)
fig.show()
def export_hourly_pv_productivity(result_ac_energies_to_csv_df, path_export_hourly):
"""
@@ -74,23 +75,13 @@ def export_hourly_pv_productivity(result_ac_energies_to_csv_df, path_export_hour
df_hourly = result_ac_energies_to_csv_df.resample('H').sum()
df_hourly.to_csv(path_export_hourly, encoding='utf-8')
print(f"File CSV orario salvato in: {path_export_hourly}")
fig = px.line(
df_hourly,
x=df_hourly.index,
y='gen_pv_100_kWp',
title='Produttività Fotovoltaica su Base Oraria',
labels={'gen_pv_100_kWp': 'Energia [kWh]', 'index': 'Data/Ora'}
)
fig.show()
# --- USO DELLA FUNZIONE DOPO L'EXPORT ORIGINALE ---
return df_hourly
# Scegli il percorso per il nuovo file orario
path_export_hourly = path_export.replace('.csv', '_hourly.csv')
# Esporta il file orario
export_hourly_pv_productivity(result_ac_energies_to_csv_df, path_export_hourly)
df_hourly = export_hourly_pv_productivity(result_ac_energies_to_csv_df, path_export_hourly)
<<<<<<< HEAD
import pandas as pd
@@ -183,6 +174,11 @@ fig.update_layout(
)
fig.show()
=======
# GENERAZIONE GRAFICI
generate_grafico_torri_df(result_ac_energies_to_csv_df, 'Produttività Fotovoltaica nel Tempo')
generate_grafico_torri_df(df_hourly, 'Produttività Fotovoltaica a Base Oraria')
>>>>>>> 0d40d3730f0ffa115039b3330b8c5cd8e4a090f8
if joePlaying:
joe.terminate()