Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
9 changes: 8 additions & 1 deletion q01_load_data_and_add_column_names/build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# %load q01_load_data_and_add_column_names/build.py
import pandas as pd


path = 'data/GermanData.csv'

def q01_load_data_and_add_column_names():
def q01_load_data_and_add_column_names(path):
df = pd.read_csv(path, header=None)
df.columns=['account_status', 'month', 'credit_history', 'purpose', 'credit_amount', 'savings_account/bonds','employment', 'installment_rate', 'personal_status/sex', 'guarantors', 'residence_since',
'property', 'age', 'other_installment_plans', 'housing', 'number_of_existing_credits', 'job', 'liable', 'telephone', 'foreign_worker', 'good/bad']
df['good/bad'] = df['good/bad'].apply(lambda x: 0 if x==1 else 1)
return df

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 9 additions & 2 deletions q02_plot_all_variable/build.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# %load q02_plot_all_variable/build.py
import pandas as pd
import numpy as np
import sys, os
Expand All @@ -8,5 +9,11 @@

path = 'data/GermanData.csv'

def q02_plot_all_variable():

def q02_plot_all_variable(path,d=5):
df = q01_load_data_and_add_column_names(path)
num = df.select_dtypes(['int64']).columns
for i in range(0,len(num)):
for j in range(0,len(num)):
plt.plot(df[num[i]],df[num[j]])
plt.show()

Binary file not shown.
Binary file not shown.