-
Notifications
You must be signed in to change notification settings - Fork 44
Pandas 1 fixes #268
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
Pandas 1 fixes #268
Changes from all commits
0d3333f
b0cc0df
552152f
b9ddead
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,12 +237,15 @@ def alpha_correlation(output_dir: str, | |
|
|
||
|
|
||
| def _reindex_with_metadata(column, columns, merged): | ||
| merged.set_index(column, inplace=True) | ||
| merged.sort_index(axis=0, ascending=True, inplace=True) | ||
| merged = merged.groupby(level=[column]) | ||
| counts = merged.count() | ||
| counts.drop(columns, axis=1, inplace=True, level=0) | ||
| median_ = merged.median() | ||
| reindexed = merged.set_index(column) | ||
| reindexed.sort_index(axis=0, ascending=True, inplace=True) | ||
| grouped = reindexed.groupby(level=[column]) | ||
| counts = grouped.count() | ||
| # Removes the column name used to set the index of `merged` above | ||
| col_diff = set(columns) - set([column]) | ||
| if col_diff: | ||
thermokarst marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| counts.drop(col_diff, axis=1, inplace=True, level=0) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first kwarg taken by
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nah, this looks good to me |
||
| median_ = grouped.median() | ||
| return median_, counts | ||
|
|
||
|
|
||
|
|
||
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.
Avoid mutating
mergedby assigning to a new DataFramereindexed.