Skip to content Skip to sidebar Skip to footer

Python Pandas: Print The Csv Data In Oder With Columns

 Hi I am new with python, I am using pandas to read the csv file data, and print it. The code is shown as following: import numpy as np import pandas as pd import codecs from

Solution 1:

You can check unicode-formatting and set:

pd.set_option('display.unicode.east_asian_width', True)

I test it with UTF-8 version csv:

dframe = pd.read_csv("test/geonlp_japan_station/geonlp_japan_station_20130912_u.csv") 

and it seems align of output is better.

pd.set_option('display.unicode.east_asian_width', True)
print dframe


pd.set_option('display.unicode.east_asian_width', False)
print dframe

Post a Comment for "Python Pandas: Print The Csv Data In Oder With Columns"