0

read_csv table

I created a csv file and used pandas.read_csv in order to access it. I used

euler_tens = pd.read_csv(filename)

and you can see that this table displays when I simply run the variable name. How do I simply save this image as a png file? This table is exactly what I needed, but now I can't seem to get that image, and I don't want to just screenshot it.

  • share the csv or dataframe as text first or check https://stackoverflow.com/a/63387275/1138192 – A l w a y s S u n n y Jan 19 '22 at 17:17
  • Does this answer your question? [How to save a pandas DataFrame table as a png](https://stackoverflow.com/questions/35634238/how-to-save-a-pandas-dataframe-table-as-a-png) – BigBen Jan 19 '22 at 17:19
  • @BigBen yes, combined with the response below I was able to find the proper additional keyword to make it work with dataframe-image, without Chrome. Thanks! – J. O'connor Jan 19 '22 at 17:40

1 Answers1

0

You can try with dataframe-image module

pip install dataframe-image

Example:

import pandas as pd
import dataframe_image as dfi
 
euler_tens = pd.read_csv(filename)
 
dfi.export(euler_tens, 'dataframe.png')
Harsha Biyani
  • 7,049
  • 9
  • 37
  • 61