import pandas as pd
data = pd.read_csv("Coaches9.csv")
# data = pd.read_csv("coaches2019.csv")
data.head()
# data.columns = ['rank', 'school', 'conf', 'coach', 'school_pay', 'total_pay', 'max_bonus', 'bonus_paid', 'asst_pay', 'buyout']
data.columns = ['school', 'conf', 'coach', 'school_pay', 'total_pay', 'max_bonus', 'bonus_paid', 'asst_pay', 'buyout']
data
attrs = "school conf coach".split()
data[attrs] = data[attrs].astype('category')
attrs = "school_pay total_pay max_bonus bonus_paid asst_pay buyout".split()
data[attrs] = data[attrs].replace({'\$':'', ',': '', '--':0}, regex=True).astype('float')
data.isnull().sum()
data
data.to_csv('v2_coaches9.csv')