0
나는이 같은 온도에 대한 정보가있는 파일이 : 나는 시간, 일, 월별 온도 및 그룹 평균과 저장 팬더를 사용하고자하는팬더는 GROUPBY - 차원의 잘못된 번호는
DateTime,Temperature
2014-11-12-12:43:12,24
2014-12-12-13:45:12,10
2014-12-12-13:46:12,20
2014-12-13-05:47:13,24
2014-12-13-05:48:13,20
2014-12-13-06:49:13,24
을 결과는 다른 파일에 있습니다. 이런 식으로 뭔가 :
df = pd.read_csv("datatemp.dat", parse_dates='DateTime', index_col=0, sep=",")
month_day_hour_means = df.groupby(lambda x: (x.hour, x.month)).mean()
print df
불행하게도 나는이 오류가있어 :
ValueError: Buffer has wrong number of dimensions (expected 1, got 2)
이 하나가 나를 도울 수를이 코드를 시도
Month,Day,Hour,AverageTemperature
11,12,12,24
12,12,13,15
12,13,05,22
12,13,06,22
?
df.groupby가 ([df.index.hour, df.index.month가). 평균()는 잘 작동한다. 고마워. – user1680012