Pandas: SettingWithCopyWarning, trying to understand how to write the code better, not just whether to ignore the warning
问题 I am trying to change all date values in a spreadsheet's Date column where the year is earlier than 1900, to today's date, so I have a slice. EDIT: previous lines of code: df=pd.read_excel(filename)#,usecols=['NAME','DATE','EMAIL'] #regex to remove weird characters df['DATE'] = df['DATE'].str.replace(r'[^a-zA-Z0-9\._/-]', '') df['DATE'] = pd.to_datetime(df['DATE']) sample row in dataframe: name, date, email [u'Public, Jane Q.\xa0' u'01/01/2016\xa0' u'jqpublic@email.com\xa0'] This line of code