-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplots.py
42 lines (30 loc) · 1.22 KB
/
plots.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
import seaborn as sb
import matplotlib.pyplot as plt
import pandas as pd
def plots_things_about_reinbursement_rate(df):
# Price vs reinbursement rate
sb.stripplot(x="price", y="reinbursement_rate", data=df, jitter=True)
plt.show()
sb.stripplot(x="commercialisation_date", y="reinbursement_rate", data=df, jitter=True)
plt.show()
sb.stripplot(x="clearance_date", y="reinbursement_rate", data=df, jitter=True)
plt.show()
sb.stripplot(x="SMR_score", y="reinbursement_rate", data=df, jitter=True)
plt.show()
print(pd.crosstab(df["reinbursement_rate"], df["clearance_type"]))
def plots_things_about_price(df):
# Price distribution
sb.distplot(df["price"])
plt.show()
# Price vs galenic form plot (not very useful, some outliers for comprimes/gelules/injections)
p = sb.stripplot(x="galenic_form", y="price", data=df)
p.set_xticklabels(p.get_xticklabels(), rotation=45)
plt.show()
# Price vs reinbursement rate
p = sb.stripplot(x="reinbursement_rate", y="price", data=df, jitter=True)
plt.show()
# Price vs owner
p = sb.boxplot(x="owners", y="price", data=df)
p.set_xticklabels(p.get_xticklabels(), rotation=45)
plt.show()