Translations:Dimensionner une installation photovoltaïque autonome/137/en

import pandas as pd
df = pd.read_csv('output.csv', skiprows=10, skipfooter=11, sep=',', engine='python')
df['time']=df['time'].astype(str)
df['time']=pd.to_datetime(df['time'],format="%Y%m%d:%H%M")
df=df.set_index('time')
daily_data = df.resample('D').sum()
dec_jan_data = daily_data[(daily_data.index.month == 12) | (daily_data.index.month == 1)]
print("Mean daily production in january and december")
print(str(dec_jan_data['P'].mean()/1000)+" kWh")
max_streak = 0
current_streak = 0
current_sum=0
target=1000
streaks=[]
for value in dec_jan_data['P']:
    if current_sum <= target:
        current_sum+=value
        current_streak += 1
        max_streak = max(max_streak, current_streak)
    else:
        streaks.append(current_streak)
        current_sum=0
        current_streak=0
print("maximum nb of consecutive days for 1kWc to produce 1kWh: "+str(max_streak)+" j")
print("number of occurences: "+ str(streaks.count(max_streak)))
print("mean nb of consecutive days for 1kWc to produce 1kWh: "+str(sum(streaks)/len(streaks))+" j")