Python 3.x 无法分析字符串";19961101-11:00“;在位置0处

Python 3.x 无法分析字符串";19961101-11:00“;在位置0处,python-3.x,pandas,machine-learning,Python 3.x,Pandas,Machine Learning,我尝试了这些东西,但没有得到结果。 请帮忙 谢谢您的“datetime\u utc”时间不是数字,可能是pd.to\u datetime(df['datetime\u utc'))会起作用。您的列似乎包含默认情况下pd.to\u数字会引发错误的日期。如果需要datetime数据类型,应该执行pd.to\u datetime。或者将pd.to_numeric上方的连字符和冒号替换为 df['datetime_utc'] = pd.to_numeric(df['datetime_utc']) df[

我尝试了这些东西,但没有得到结果。 请帮忙
谢谢

您的“datetime\u utc”时间不是数字,可能是
pd.to\u datetime(df['datetime\u utc'))
会起作用。您的列似乎包含默认情况下pd.to\u数字会引发错误的日期。如果需要datetime数据类型,应该执行pd.to\u datetime。或者将pd.to_numeric上方的连字符和冒号替换为
df['datetime_utc'] = pd.to_numeric(df['datetime_utc'])
df['datetime_utc'] = (df['datetime_utc'].replace('-',regex=True).replace(':',regex=True))
df["datetime_utc"] = Erzeugung.solar_prediction.str.replace(':').astype("float64")