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 

output

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() 

enter image description here


Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -

qt - Microsoft FTP Service 451 The parameter is incorrect -