Python-FamaMacBeth无法将datetimelike从[datetime64[ns]]键入到[float64]
当尝试在我的数据集上运行Python-FamaMacBeth无法将datetimelike从[datetime64[ns]]键入到[float64],python,python-3.x,time-series,regression,Python,Python 3.x,Time Series,Regression,当尝试在我的数据集上运行famacabeth回归时,我得到TypeError: cannot astype a datetimelike from [datetime64[ns]] to [float64], “我的日期”列的类型为numpy.ndarray 有人知道我做错了什么吗?这是一个: 问题是,我们不支持pandas对象上的datetime64[s]类型,即使它是NumPy数组的有效类型 一种可能的解决方法是直接转换为浮动,如对该问题的评论:
famacabeth
回归时,我得到TypeError
:
cannot astype a datetimelike from [datetime64[ns]] to [float64],
“我的日期”列的类型为numpy.ndarray
有人知道我做错了什么吗?这是一个:
问题是,我们不支持pandas对象上的datetime64[s]类型,即使它是NumPy数组的有效类型
一种可能的解决方法是直接转换为浮动,如对该问题的评论: