我尝试delete一些列并在列中转换一些值
df2.drop(df2.columns[[0, 1, 3]], axis=1, inplace=True)
df2['date'] = df2['date'].map(lambda x: str(x)[1:])
df2['date'] = df2['date'].str.replace(':', ' ', 1)
df2['date'] = pd.to_datetime(df2['date'])
Run Code Online (Sandbox Code Playgroud)
我得到的所有这些字符串
df2.drop(df2.columns[[0, 1, 3]], axis=1, inplace=True)
C:/Users/????? ???????????/Desktop/projects/youtube_log/filter.py:11: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
Run Code Online (Sandbox Code Playgroud)
那有什么问题?