python 3.x - Displaying Pandas Series with Asian text in index -
if index of pandas
series
in 1 of asian languages , has variable lengths, print-out not aligned correctly.
import pandas pd ipython.display import display df = pd.series( range(2), index = [ 'ミートボールスパゲッティ', 'ご飯' ] ) display(df) print(df) df
note happens series
, dataframe
display
can display content nicely.
how can fix output here?
convert series
dataframe
display. currently, series
have no to_html()
method. therefore, cannot displayed in format directly.
import pandas pd ipython.display import display df = pd.series( range(2), index = [ 'ミートボールスパゲッティ', 'ご飯' ] ) df.to_frame()
Comments
Post a Comment