Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Create a boxplot of the tips grouped by the day
- time_groups = tips_data.groupby(['day'])
- sun_time = time_groups.get_group('Sun')
- sat_time = time_groups.get_group('Sat')
- thur_time = time_groups.get_group('Thur')
- fri_time = time_groups.get_group('Fri')
- col1 = sun_time['tip']
- col2 = sat_time['tip']
- col3 = thur_time['tip']
- col4 = fri_time['tip']
- DF = pd.DataFrame({'sunday': col1, 'saturday': col2, 'thursday' : col3, 'friday': col4})
- ax = DF[['sunday', 'saturday', 'thursday', 'friday']].plot(kind='box', title='boxplot', showmeans=True)
- plt.show()
- # Create a histogram of the tips grouped by the day
- g = sns.FacetGrid(tips_data, row = 'day')
- g = g.map(plt.hist, 'tip')
- ################################################################
- '''
- bp = sns.boxplot(data=da.loc[:, ["BPXSY1", "BPXSY2", "BPXDI1", "BPXDI2"]])
- bp.set_ylabel("Blood pressure in mm/Hg")
- '''
- #################################################################
- sns.boxplot(x = df['Branch'], y = df['gross income'])
- plt.boxplot([op1["Length"], op2["Length"]])
- plt.xlabel("Op-1 and Op-2")
- plt.ylabel("Length in mm")
- plt.title("Plot Length in Op-1 and Op-2")
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement