• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Ability to write and read comma-text in csv file in Python language

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

###########################################
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"

Please guide me.
Thanks alot
 
Marshal
Posts: 65466
249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please avoid coloured text, which some people can't read. I have changed it all to black text.
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!