1

I have done this kind of things in JupyterNotebooks and Sypder IDE, however, when i try to read a print a csv file in Pycharm, it shows the data with the separator, not tabulated as I wish.

I have tried the following:

import pandas as pd

print("~"*50)
see = pd.read_csv(r"C:\Users\HP\pythonProject\Modulo6\bank.csv ", sep=";")
print(see)

And what I get in terminal is this:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     age;"job";"marital";"education";"default";"balance";"housing";"loan";"contact";"day";"month";"duration";"campaign";"pdays";"previous";"poutcome";"y"
0     30;"unemployed";"married";"primary";"no";1787;...
1     33;"services";"married";"secondary";"no";4789;...
2     35;"management";"single";"tertiary";"no";1350;...
3     30;"management";"married";"tertiary";"no";1476...
4     59;"blue-collar";"married";"secondary";"no";0;...
...                                                 ...
4516  33;"services";"married";"secondary";"no";-333;...
4517  57;"self-employed";"married";"tertiary";"yes";...
4518  57;"technician";"married";"secondary";"no";295...
4519  28;"blue-collar";"married";"secondary";"no";11...
4520  44;"entrepreneur";"single";"tertiary";"no";113...

[4521 rows x 1 columns]

Sample of raw csv data, copied straight from Excel :

age;"job";"marital";"education";"default";"balance";"housing";"loan";"contact";"day";"month";"duration";"campaign";"pdays";"previous";"poutcome";"y" 30;"unemployed";"married";"primary";"no";1787;"no";"no";"cellular";19;"oct";79;1;-1;0;"unknown";"no"

0 Answers0