Skip to content

Instantly share code, notes, and snippets.

@thepycoach
Created January 28, 2022 01:08
Show Gist options
  • Select an option

  • Save thepycoach/97b1373db7abb13811f0fb1ff9660d1b to your computer and use it in GitHub Desktop.

Select an option

Save thepycoach/97b1373db7abb13811f0fb1ff9660d1b to your computer and use it in GitHub Desktop.
from mitosheet import *; register_analysis('UUID-2c83756f-c360-403c-be50-951b26c54ac1')
# Imported StudentsPerformance_id.csv
import pandas as pd
StudentsPerformance_id_csv = pd.read_csv(r'StudentsPerformance_id.csv')
# Import plotly and create a figure
import plotly.graph_objects as go
fig = go.Figure()
# Add box plots to the graph
for column_header in ['math score', 'reading score', 'writing score']:
fig.add_trace(go.Box(y=StudentsPerformance_id_csv[column_header], name=str(column_header)))
# Update the title and stacking mode of the graph
# See Plotly documentation for customizations: https://plotly.com/python/reference/box/
fig.update_layout(
title='math score, reading score, writing score box plot',
barmode='stack'
)
fig.show(renderer="iframe")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment