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("maximum nb of consecutive days for 1kWc to produce 3kWh: "+str(max_streak)+" j") print("nombre d'occurences: "+ str(streaks.count(max_streak))) print("mean nb of consecutive days for 1kWc to produce 3kWh: "+str(sum(streaks)/len(streaks))+" j")
Vous avez entré un nom de page invalide, avec un ou plusieurs caractères suivants :
< > @ ~ : * € £ ` + = / \ | [ ] { } ; ? #