I am countering a strange error , this code was working earlier (earlier runs of code, few hours back) but now it isn't .
import numpy as np
import pandas as pd
df = pd.read_csv('nlp_monta.csv')
df['Text 2'] = pd.Series(map(lambda x: str(x).replace("^"," "), df['Text']))
i=0;
for row in df['Text 2']:
df.iloc[i]['Text 2'] = set(row.split()) # This isn't giving unique words
i=i+1 #earlier it was
The warning, though the code is working - Image of results
C:\Users\ishanna\AppData\Local\Continuum\anaconda3\lib\site->packages\ipykernel_launcher.py:2: 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