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

max_streak = 0 current_streak = 0 current_sum=0 target=2000 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("maximum nb of consecutive days for 1kWc to produce 2kWh: "+str(max_streak)+" j") print("number of occurences: "+ str(streaks.count(max_streak))) print("mean nb of consecutive days for 1kWc to produce 2kWh: "+str(sum(streaks)/len(streaks))+" j")