andre non ci sta più capendo un cabbo
This commit is contained in:
@@ -54,14 +54,15 @@ 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')
|
||||
|
||||
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(
|
||||
result_ac_energies_to_csv_df,
|
||||
x=result_ac_energies_to_csv_df.index,
|
||||
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()
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user