-
Notifications
You must be signed in to change notification settings - Fork 76
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
[FIX] Clean up code #310
base: main
Are you sure you want to change the base?
[FIX] Clean up code #310
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
def _to_upper_hierarchy(bottom_split, bottom_values, upper_key): | ||
# %% ../nbs/src/utils.ipynb 10 | ||
def _to_upper_hierarchy( | ||
bottom_split: List[str], bottom_values: str, upper_key: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now that the min python is 3.9 you could use the collections directly, e.g. list[str]
instead of typing.List[str
df_nw = nw.from_dict( | ||
{id_col: unique_ids, time_col: ds, model_name: forecasts_mean}, | ||
native_namespace=namespace, | ||
) | ||
df_nw = df_nw.with_columns(**dict(zip(col_names, forecasts_quantiles.T))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be more efficient to create the df in one go
df_nw = nw.from_dict( | |
{id_col: unique_ids, time_col: ds, model_name: forecasts_mean}, | |
native_namespace=namespace, | |
) | |
df_nw = df_nw.with_columns(**dict(zip(col_names, forecasts_quantiles.T))) | |
df_nw = nw.from_dict( | |
{ | |
**{id_col: unique_ids, time_col: ds, model_name: forecasts_mean}, | |
**dict(zip(col_names, forecasts_quantiles.T)), | |
}, | |
native_namespace=namespace, | |
) |
backend
that will return a df of the chosen backend