python3
1--------------------------------------------------------------------------- 2ValueError Traceback (most recent call last) 3<ipython-input-7-4135c7fd37a7> in <module> 4 34 # 「日時」が2016-05-11~2017-05-10 → 2016-05-11、など 5 35 aligned = values.assign( 6---> 36 announcement_date=lambda x: pd.cut( 7 37 x['日時'], 8 38 ( 9 10~\Anaconda3\lib\site-packages\pandas\core\frame.py in assign(self, **kwargs) 11 3652 if PY36: 12 3653 for k, v in kwargs.items(): 13-> 3654 data[k] = com.apply_if_callable(v, data) 14 3655 else: 15 3656 # <= 3.5: do all calculations first... 16 17~\Anaconda3\lib\site-packages\pandas\core\common.py in apply_if_callable(maybe_callable, obj, **kwargs) 18 363 19 364 if callable(maybe_callable): 20--> 365 return maybe_callable(obj, **kwargs) 21 366 22 367 return maybe_callable 23 24<ipython-input-7-4135c7fd37a7> in <lambda>(x) 25 40 ) + [np.datetime64(values['日時'].max() + pd.offsets.Day())], 26 41 labels=announcement_dates, 27---> 42 right=False 28 43 ).astype( 29 44 np.datetime64 30 31~\Anaconda3\lib\site-packages\pandas\core\reshape\tile.py in cut(x, bins, right, labels, retbins, precision, include_lowest, duplicates) 32 258 # GH 26045: cast to float64 to avoid an overflow 33 259 if (np.diff(bins.astype("float64")) < 0).any(): 34--> 260 raise ValueError("bins must increase monotonically.") 35 261 36 262 fac, bins = _bins_to_cuts( 37 38ValueError: bins must increase monotonically.
で、しつもんはなんでしょうか
回答1件
あなたの回答
tips
プレビュー