LernerPythonブログ、Reuven Lernerよ... ノート

LernerPythonブログ、Reuven Lernerより:Pandas DatetimeIndexのスライシング:sort_indexでKeyErrorを修正

Python Pandasでソートされていないdatetimeインデックスをスライスすると、おそらく以下のエラーが発生します。KeyError: ‘Value based partial slicing on non-monotonic DatetimeIndexes with non-existing keys is not allowed.’なぜでしょうか?日付がソートされていない場合、Pandasはどこから開始/停止すべきでしょうか?解決策:sort_index()!
CdXz5zHNQW_rTcYH1V05z.png