Skip to content

Instantly share code, notes, and snippets.

@mencarellic
Created July 26, 2018 02:24
Show Gist options
  • Save mencarellic/377c44bc06bdd849dd401f1d4aac5ede to your computer and use it in GitHub Desktop.
Save mencarellic/377c44bc06bdd849dd401f1d4aac5ede to your computer and use it in GitHub Desktop.
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plot
import string
df = pd.read_csv("C:\git\IST718\Week2_Class\Coaches.csv")
df.fillna(0, inplace=True)
df['TotalSalary'] = df['TotalSalary'].str.replace('$','')
df['TotalSalary'] = df['TotalSalary'].str.replace(',', '')
df['TotalSalary'] = df['TotalSalary'].str.strip()
print(df['TotalSalary'])
df['TotalSalary'] = pd.to_numeric(df['TotalSalary'])
sns.set(style="whitegrid")
## Attendance Box & Whisker Plot
fig1, axis1 = plot.subplots()
plot1 = sns.boxplot(x='Conference', y='TotalSalary', data=df, palette="Set3", linewidth=1.25)
fig1.suptitle('Salary Box & Whisker Plot')
axis1.set_ylabel('Salary')
plot1.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment