Skip to content

Instantly share code, notes, and snippets.

@GastonMazzei
Last active August 31, 2020 21:19
Show Gist options
  • Save GastonMazzei/24703003003c66f55c64c1776be119d0 to your computer and use it in GitHub Desktop.
Save GastonMazzei/24703003003c66f55c64c1776be119d0 to your computer and use it in GitHub Desktop.
CSV to Table
import plotly.graph_objects as go
import pandas as pd
df = pd.read_csv('path/to/file.csv')
# You might want to change the "wanted columns"
wanted_columns = ['time']
wanted_columns += [f'Question {x+1}' for x in range(6)]
wanted_columns += [f'Answer {x+1}' for x in range(6)]
fig = go.Figure(data=[go.Table(
header=dict(values=wanted_columns,
fill_color='paleturquoise',
align='left'),
cells=dict(values=[df[wanted_columns]],
fill_color='lavender',
align='left'))
])
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment