I am trying to export the data frame to an image. I used the dataframe_image lib to do this activity.
import pandas as pd
import dataframe_image as dfi
data = [
{
"name": "John",
"gender": "Male"
},
{
"name": "Martin",
"gender": "Female"
}
]
df = pd.json_normalize(data)
dfi.export(df, 'table.png')
The exported image looks like the below:
I want to remove the index column from this. How can I do that ?
CodePudding user response:
You can set the style to hide the index:
dfi.export(df.style.hide(axis='index'), 'table.png')