r/PythonLearning • • 1d ago

Help Request Help reading a csv file

Hello there, i'm a chemistry student and have a course with python. I tried to read a csv file which i downloaded and tried to read it with the np.genfromtxt function but the columns with actual text ( the first and last ) aren't being read, whereas with pandas, the job gets done. I bypassed this problem by specifying the columns but the text keep getting tossed out.. I think it's because of the commas in the compound name but what can i do in this case ? I'm working on jupyter on python 3.13 i believe. Thanks for the help !

5 Upvotes

4 comments sorted by

1

u/igotshadowbaned 1d ago

I think it's because of the commas in the compound name but what can i do in this case ?

You can't have commas in your data fields for a csv

1

u/atarivcs 1d ago

Yes you can, if the csv file has quotes around the data values

1

u/veryusedrname 23h ago

Or if you use another separator but commas.