PythonPandasDataFrameCSV file: issue with csv file?

Question:

I’m a beginner in python programming. I was doing a school project with pandas with csv file and when I print the table it shows
not the result I wanted

This is the actual csv file i created
csv file i created

I hope anyone can help me with this.

Asked By: Abhay

||

Answers:

Because I don’t have your data, I provide my suggestion for you by following two points.

1.Clean and set your csv file like this form – first row is header and rest of them are data.

2.Use this code to import your csv file. (skip the first row from your csv file)

pandas read csv where csv's col names are in second row?

Please let me know if you still have any question

Thanks
Leon

Answered By: Leon Li

To conveniently print your table, use the methods for setting the output format – set_option (), for example, to remove the restriction on the number of columns –
pd.set_option('display.max_columns', None).
If you are using a development environment, then it is better to put a breakpoint on pass and run in debug mode. In pycharm, in the variable area, you can click on …View as DataFrame and a color readable table will appear.

Answered By: Сергей Кох