#-*-coding:utf-8-*-#Data IntegrationImportCSVImportNumPy as NPImportPandas as PDImportMatplotlib.pyplot as Plt#Customer InformationBasicinfo = PD. Dataframe.from_csv ('Datas/basicinfo_train.csv', header=0, sep=',', Index_col=0, Parse_dates=true, Encoding=none, Tupleize_cols=false, infer_datetime_format=False)#Historical Repayment RecordsHistoryinfo = PD. Dataframe.from_csv ('Datas/history_train.csv', header=0, sep=',', Index_col=0, Parse_dates=true, Encoding=none, Tupleize_cols=false, infer_datetime_format=False)#Historical Overdue SituationDefaultinfo = PD. Dataframe.from_csv ('Datas/default_train.csv', header=0, sep=',', Index_col=0, Parse_dates=true, Encoding=none, Tupleize_cols=false, infer_datetime_format=False) Combineinfo= Pd.concat ([Basicinfo,historyinfo,defaultinfo],axis=1)
# View Top 10 data Combineinfo[:10]
#Gender AnalysisGender = Combineinfo.groupby ('SEX')['Default'].mean (). Reset_index () plt.xticks (0,1), (U"Male", u"Female")) Plt.xlabel (U"Gender") Plt.ylabel (U"Counts") Plt.bar (gender. Sex,gender. Default,0.1,color='Green') plt.show ()
# correlation analysis between education level and default value edu = Combineinfo.groupby ( " ' ) [ ' default
# Marital Status Analysis marriage = combineinfo.groupby ('marriage') ['Default ' ].mean (). Reset_index () Plt.bar (marriage. Marriage,marriage. Default,0.5,color='green') plt.show ()
Python Big Data: credit card overdue analysis