1
我有熊猫一个多指标,看起来像由下面的代码生成一个:转换大熊猫多指标为datetime格式
arrays = [[2001, 2001, 2003, 2004], ['January', 'March', 'June', 'December']]
tuples= list(zip(*arrays))
index = pd.MultiIndex.from_tuples(tuples, names=['year', 'month'])
我想这个指标转换为单个日期时间指数。我试过使用
pd.to_datetime(index, format="%Y %B")
但它给了我一个错误。
请问您能否以最有效的方式提供一些帮助?
感谢