mirror of
https://github.com/13hannes11/UU_NCML_Project.git
synced 2024-09-03 20:50:59 +02:00
cleaned up uk code for data loading
This commit is contained in:
@@ -59,11 +59,13 @@ def load_german_data():
|
||||
return data
|
||||
|
||||
|
||||
def load_uk_data():
|
||||
def load_uk_data(path):
|
||||
"""
|
||||
Load German Parliament data
|
||||
return : Data with columns [Member, Party, vote_0, vote_1 etc]
|
||||
"""
|
||||
#print directory path
|
||||
print(path)
|
||||
# Preprocess data
|
||||
vote_counter = -1
|
||||
data = pd.DataFrame()
|
||||
@@ -75,7 +77,7 @@ def load_uk_data():
|
||||
column_to_filename = {}
|
||||
|
||||
voting_features = {'Aye':0, 'Teller - Ayes':0, 'No':1, 'Teller - Noes':1, 'No Vote Recorded':2}
|
||||
for dirname, _, filenames in os.walk('./uk/csv'):
|
||||
for dirname, _, filenames in os.walk(path):
|
||||
for filename in filenames:
|
||||
vote_counter += 1
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ def get_compass_parties(year=2017, country='de'):
|
||||
data = [[-3.5, -4], [7, 6.5], [-7, -6.5], [1, 2]]
|
||||
index = ['BÜ90/GR', 'CDU/CSU', 'DIE LINKE.', 'SPD']
|
||||
elif year == 2005:
|
||||
# TODO: add data for 2011
|
||||
data = [[-1.5, -1.5], [9.5, 8], [-6, -2], [3, 3.5]]
|
||||
index = [ 'BÜ90/GR', 'CDU/CSU', 'DIE LINKE.', 'SPD']
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user