这段代码首先创建了一个datetime64[ns]类型的数组,然后将其转换为自Unix纪元以来的天数,并最后将天数转换为float32类型。请注意,这里的float32需要作为np.float32来导入,即from numpy import float32。 通过以上步骤,你应该能够解决“TypeError: cannot cast datetime64[ns] to dtype float32”的问题。如果问题仍然...
import opensearch_py_ml as oml -> ImportError: cannot import name 'is_datetime_or_timedelta_dtype' from 'pandas.core.dtypes.common' Here is a screenshot: How can one reproduce the bug? Follow the dev guide:https://github.com/opensearch-project/opensearch-py-ml/blob/main/DEVELOPER_GUIDE.md...