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("\n") 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")
Vous avez entré un nom de page invalide, avec un ou plusieurs caractères suivants :
< > @ ~ : * € £ ` + = / \ | [ ] { } ; ? #