import seaborn as sns
import matplotlib.pyplot as plt
df=sns.load_dataset('taxis')
def payment():
sns.scatterplot(data=df, x='fare', y='tip', hue='payment')
payment()
def pickup_dropoff():
with sns.axes_style('white'):
g = sns.catplot(x="pickup_borough", data=df, aspect=2,
kind="count", color='steelblue')
k = sns.catplot(x="dropoff_borough", data=df, aspect=2,
kind="count", color='steelblue')
pickup_dropoff()
<result>
def passengers():
sns.violinplot(x="passengers", y="total", data=df,
palette=["lightblue", "lightpink"]);
passengers()
def pay_tip():
sns.boxplot(x='payment', y='fare', data=df)
plt.title('Fare by Payment Method')
plt.show()
sns.boxplot(x='payment', y='tip', data=df)
plt.title('Tip by Payment Method')
plt.show()
pay_tip()
'Analysis' 카테고리의 다른 글
[데이터마이닝] Lab7-aggregation group by (0) | 2024.12.05 |
---|---|
[데이터마이닝] worldcloud lab6 (0) | 2024.12.05 |
[데이터마이닝] Scikit-learn Winedata Lab4-sample (0) | 2024.12.05 |
[데이터마이닝] matplotlib - random 3 lap 과제 (0) | 2024.12.05 |
[데이터마이닝] Numpy-학생 SAMPLE upload- Lab2 과제 (1) | 2024.12.05 |