본문 바로가기
프로그램

[파이썬] pandas Dataframe을 이미지로 저장

by 오디세이99 2022. 10. 4.
728x90
반응형

 

package 설치

pip install dataframe_image 

 

 

다음과 같이 dataframe을 이미지로 자장 할 수 있습니다.

import pandas as pd
import dataframe_image as dfi

dict_item = {
    'item1': [0, 1, 0, 0],
    'item2': [1, 0, 1, 0],
    'item3': [1, 0, 0, 1]
}
df_item = pd.DataFrame(dict_item)
print(df_item)

dfi.export(df_item, 'pandasToimage01.png', max_cols=-1, max_rows=-1)

 

728x90
반응형

댓글