【问题标题】:Find the average windspeed in January for each location查找每个位置 1 月份的平均风速
【发布时间】:2019-12-11 20:13:40
【问题描述】:

求 1968-1672 年 1 月份每个位置的平均值

观察数据以清晰理解: https://github.com/prataplyf/Wind-DateTime/blob/master/wind_data.csv

year = wind.index.year.unique()
year

month = wind[(wind.index.year==wind.index.year.unique())]
month.mean()```






get 'mean()' of each location only Jan data
Output format
         RPT   VAL  ...... ...... ..... ...... .... ....BEL MAL
1961-1 
1962-1
1963-1
.
.
.
.
.
1672-1

【问题讨论】:

标签: pandas-groupby


【解决方案1】:

Data.loc[(Data['Date'].dt.month==1)].mean()

试试这个

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-19
    • 1970-01-01
    • 2019-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多