使用这个简单的代码行,我继续得到一个SettingWithcopyWarning错误,而不是通过我的整个代码.
#make email a string df['Email Address'] = df['Email Address'].astype(str) C:\Users\xxx\AppData\Local\Continuum\Anaconda2\lib\site-packages\ipykernel\__main__.py:2: 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 See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy from ipykernel import kernelapp as app
df.loc['Email Address'] = df.loc['Email Address'].astype(str)