Last active
August 31, 2020 21:19
-
-
Save GastonMazzei/24703003003c66f55c64c1776be119d0 to your computer and use it in GitHub Desktop.
CSV to Table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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