I wrote the code to output the data saved as csv in Python using pandas.
However, when I try to output the results, the header part written in Japanese and the numerical value are out of alignment.
As I touched it, I realized that if you type the header in English and the csv header in English, you will get a neatly aligned table.Can you arrange the headers neatly in Japanese?I also use Windows.Is there a problem with this?
csv code:
Name, Korean, Mathematics, English, Science, Society
A-thick, 83, 89, 76, 97, 76
B-suke, 66, 93, 75, 88, 76
C-child, 100, 84, 96, 82, 94
Duro, 60, 73, 63, 52, 70
E Beauty, 92, 62, 84, 80, 78
F vegetables, 96, 92, 94, 92, 90
source code:
import pandas as pd
df = pd.read_csv("test.csv")
print(df)
@metropolis-san I heard that it was resolved in the comment, and based on that, I answered as a community wiki.
Status at Question Time:
>>import pandas as pd
>>
>>>df=pd.read_csv("test.csv")
>>
>>print(df)
Naming Language Mathematics English Science Society
0 A thick 838976 9776
1B-mediated 6693758876
2 C child 10084 96 8294
3Duro 6073 63 5270
4E Beauty 926284 8078
5 F veggies 96 92 94 92 90
Comment Application Results:
>>pd.set_option('display.unicode.east_asian_width', True)
>>print(df)
Naming Language Mathematics English Science Society
0 A thick 838976 9776
1B-mediated 6693758876
2 C child 10084 96 8294
3Duro 6073 63 5270
4E Beauty 926284 8078
5 F veggies 96 92 94 92 90
Comment related specification destination:
Unicode formatting-Options and settings
It contains descriptions of additional options for characters with ambiguous width, such as twice the display performance.
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
928 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
624 GDB gets version error when attempting to debug with the Presense SDK (IDE)
586 PHP ssh2_scp_send fails to send files as intended
575 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.