Hi,
In a csv file, a number of comment texts are written that contain commas (,). Since in the csv file it defaults to commas by default, I'm going to use quotation marks to separate the columns, but I get the following error:
in section "What have you tried?"
Please guide me.
Thanks alot
What I have tried:
df = pd.read_csv("train2.csv", encoding = "ISO-8859-1", error_bad_lines=False)
df_toxic = df.drop(['id', 'comment_text'], axis=1)
###########################################
error:
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py", line 4404, in drop
'{} not found in axis'.format(labels[mask]))
KeyError: "['id' 'comment_text'] not found in axis"
###########################################
The csv file is also saved as follows:
id,"comment_text","toxic","severe_toxic","obscene","threat","insult","identity_hate"
0000997932d777bf,"Explanation Why the edits made under my username Hardcore Metallica Fan were reverted? They weren't vandalisms. just closure on some GAs after I voted at New York Dolls FAC. And please don't remove the template from the talk page since I'm retired now.89.205.38.27","0","0","0","0","0","0"