我有一個數據框df['Timestamp']153917800000應用 .iso8601 作為對象返回,格式為 %Y-%m-%dT%H:%M:%S.%f 我認為。df['Timestamp']2018-10-10T12:52:00.000Z我想過濾/刪除/替換破折號“-”和“:”,以及時區:“Z”到“”期望輸出: df['Timestamp'] 20181010125200000 dtype:float所需應用:需要浮點輸入的手動功能嘗試df['Timestamp'] = pd.to_datetime(df['Timestamp'], format='%Y-%m-%dT%H:%M:%S.%f').dt.strftime('%Y%m%d').astype(float)df['Timestamp'] = (df['Timestamp'].filter(_.isdigit()))
添加回答
舉報
0/150
提交
取消