You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importmatplotlib.pyplotaspltimportpandasaspdimportiocsv='''ID,group,time,successP1,control,18.6,1P2,control,15.42,1P3,control,25.55,0P4,control,12.56,0P5,control,8.67,1P6,experiment,7.31,0P7,experiment,9.66,0P8,experiment,13.64,1P9,experiment,14.92,1P10,experiment,18.47,1'''df=pd.read_csv(io.StringIO(csv))
# create a box plot where each box refers to a groupdf.boxplot(column='time', by='group')
# remove the grid and increase the limit of y axis to 30plt.grid(False)
plt.ylim(0, 30)
# add a dashed horizontal line at y=25plt.axhline(y=25, linestyle='--')
# add a label "limit" next to the horizontal lineplt.text(x=2.45, y=25.5, s='limit')
# for each group, add scatter dots on top of the box using the time data, and mark the dots with blue if success=1, otherwise redmarkers= ['o', 'x']
colors= ['blue', 'red']
fori, groupindf.groupby('group'):
forj, (marker, color) inenumerate(zip(markers, colors)):
x=j+1y=group ['time'][group ['success'] ==j]
plt.scatter(x, y, marker=marker, color=co
lor)
There is a runtime error according to the output panel. However, instead of being displayed inside PB, the runtime error is not reported, and we have rv=None instead.
Can replicate both locally and in the web version.
The text was updated successfully, but these errors were encountered:
To replicate:
lor)
There is a runtime error according to the output panel. However, instead of being displayed inside PB, the runtime error is not reported, and we have
rv=None
instead.Can replicate both locally and in the web version.
The text was updated successfully, but these errors were encountered: