Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aaron #3

Closed
wants to merge 3 commits into from
Closed

Aaron #3

wants to merge 3 commits into from

Conversation

AaronCooke2718
Copy link
Collaborator

Terrible code.

Two functions, a rename function, and a new dictionary to use for the model.


# %%
def fix_names(df: pd.DataFrame) -> pd.DataFrame:
df = df.rename(columns={'Cases1': 'Pandemic_1', 'Cases2': 'Pandemic_2',\
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove backslashes

# return modified version of the dataframe
# Have test code to validate"""

def factordic()
Copy link
Owner

@jvivian jvivian Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can directly declare as a single return statement

return {'Cases1': ('Global1', 'Pandemic'), ...}


def factordic()
factors = {}
factors[Cases1] = 'Global', 'Pandemic'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keys aren't strings

@jvivian
Copy link
Owner

jvivian commented Dec 1, 2023

@AaronCooke2718 - Pushed fixes but some factors/mappings are missing so tests will not pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants