I work in pycharm and need to upload csv file data from excel. In the file itself, the information is broken down by columns, but pycharm shows it as if everything is in one column. How to proceed?

import numpy as np import matplotlib.pyplot as plt import pandas as pd dataset = pd.read_csv('Data.csv') print(dataset) 
  • Could you add an example of the source file, what you end up with and what you really want to see as the result of the program? - strawdog

1 answer 1

The pd.read_csv () function uses a comma as the field separator by default. If you end up with one column, then your CSV will most likely use another separator. Specify it explicitly:

 dataset = pd.read_csv('Data.csv', sep=';')