mirror of
https://github.com/13hannes11/UU_NCML_Project.git
synced 2024-09-03 20:50:59 +02:00
rename variable to vote_column_to_title to more clearly show its function
This commit is contained in:
@@ -8,7 +8,7 @@ data = pd.DataFrame()
|
|||||||
name_column = 'Member'
|
name_column = 'Member'
|
||||||
vote_column = 'Vote'
|
vote_column = 'Vote'
|
||||||
|
|
||||||
column_to_filename = {}
|
vote_column_to_title = {}
|
||||||
|
|
||||||
voting_features = {'Aye':0, 'No':1, 'No Vote Recorded':2}
|
voting_features = {'Aye':0, 'No':1, 'No Vote Recorded':2}
|
||||||
for dirname, _, filenames in os.walk('./uk/csv'):
|
for dirname, _, filenames in os.walk('./uk/csv'):
|
||||||
@@ -30,7 +30,7 @@ for dirname, _, filenames in os.walk('./uk/csv'):
|
|||||||
df=df.rename(columns={vote_column:vote_column_name})
|
df=df.rename(columns={vote_column:vote_column_name})
|
||||||
|
|
||||||
# Map column name of vote to title -> allows retrieving what the vote was about
|
# Map column name of vote to title -> allows retrieving what the vote was about
|
||||||
column_to_filename[vote_column_name] = title_df.iat[2,0]
|
vote_column_to_title[vote_column_name] = title_df.iat[2,0]
|
||||||
|
|
||||||
if data.empty:
|
if data.empty:
|
||||||
# if first file that is loaded set data equal to data from first file
|
# if first file that is loaded set data equal to data from first file
|
||||||
@@ -39,5 +39,5 @@ for dirname, _, filenames in os.walk('./uk/csv'):
|
|||||||
# merge data with already loaded data
|
# merge data with already loaded data
|
||||||
data = data.merge(df[[name_column, vote_column_name]], on=name_column)
|
data = data.merge(df[[name_column, vote_column_name]], on=name_column)
|
||||||
|
|
||||||
print(column_to_filename)
|
print(vote_column_to_title)
|
||||||
print(data)
|
print(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user