简体   繁体   中英

Why are the columns misaligned when I load a csv file into jupyter notebook (using python and pandas)?

This is all the code I've written

import numpy as np
import pandas as pd
from IPython.display import display
df = pd.read_csv("filex56345.csv")

pd.options.display.max_columns = None
df.head()

The columns are all there but the values are all bunched up to the right, out of alignment with the titles they should be under.

Everything is fine when I load the file in LibreOffice Calc..

Use the parameter delimeter=";" in read_csv

By default pandas expects it to be ","

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM