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

max_streak = 0 current_streak = 0 current_sum=0 target=3000 streaks=[] for value in daily_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("\n") print("maximum nb of consecutive days for 1kWc to produce 3kWh: "+str(max_streak)+" j") print("number of occurences: "+ str(streaks.count(max_streak))) print("mean nb of consecutive days for 1kWc to produce 3kWh: "+str(sum(streaks)/len(streaks))+" j")