Going over the documentation https://plotly.com/python/table/ I wanted to plot a data frame as a table
The documentation suggested the following
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_usa_states.csv')
fig = go.Figure(data=[go.Table(
header=dict(values=list(df.columns),
fill_color='paleturquoise',
align='left'),
cells=dict(values=[df.Rank, df.State, df.Postal, df.Population],
fill_color='lavender',
align='left'))
])
fig.show()
However, my dataframe is kind big and I wanted a better way to input the values of the columns. Something that would be better than
....values=[df.Rank, df.State, df.Postal, df.Population]....