 |
|
dongxiao
V2EX member #296057, joined on 2018-03-02 22:49:51 +08:00
|
dongxiao's recent replies
```
d[:, d.argsort(axis=1)[0]]
```
执行的时候应该有条 warning 信息吧:
```FutureWarning: Indexing a DataFrame with a datetimelike index using a single string to slice the rows, like `frame[string]`, is deprecated and will be removed in a future version. Use `frame.loc[string]` instead.
```
所以你应该这么执行:
```
df.loc["2020-01-01"]
```
想起了那年的高考作文,`深处种菱浅种稻,不深不浅种荷花`,我硬是理解成了写保护环境😂
pandas 先 rolling 后 聚合,比如以每一天与过去 7 天做比较:
1. dataframe.rolling("7d").min() == dataframe
2. dataframe.rolling("7d").min()