【发布时间】:2020-09-30 20:10:46
【问题描述】:
提前感谢您的帮助! (代码如下)(数据Here)
我想删除 5 厘米到 225 厘米列的 5/6 标准偏差之外的异常值,并将它们替换为该日期(月/日)和深度的平均值。最好的方法是什么?
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
raw_data = pd.read_csv('all-deep-soil-temperatures.csv', index_col=1, parse_dates=True)
df_all_stations = raw_data.copy()
df_selected_station.fillna(method = 'ffill', inplace=True);
df_selected_station_D=df_selected_station.resample(rule='D').mean()
df_selected_station_D['Day'] = df_selected_station_D.index.dayofyear
mean=df_selected_station_D.groupby(by='Day').mean()
mean['Day']=mean.index
mean.head()
【问题讨论】:
-
你的问题和这个帖子一模一样stackoverflow.com/questions/45386955/…
标签: python pandas numpy dataframe time-series