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.
11 changes: 10 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,15 @@

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):
'write your solution here'
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'].map({1: 0, 2: 1})
return df

Binary file not shown.
Binary file not shown.