I have a very large dataset(test) of approx 1 million rows. I want to update a column('Date') from the dataset. I just want 3 dates in my 'Date' column:
2014-04-01, 2014-05-01, 2014-06-01
So each date in one row and after every 3rd row dates are repeating.
I have tried this:
for i in range(0,len(test),3):
if(i <= len(test)):
test['Date'][i] = '2014-04-01'
test['Date'][i+1] = '2014-05-01'
test['Date'][i+2] = '2014-06-01'
I am getting this warning:
__main__:3: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
__main__:4: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
__main__:5: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
I have gone through the link but could not able to solve my issue. And I have googled it, got some solutions like copy() dataset before slicing and some others but nothing worked.