Skip to content

CLN: move routines for filling missing data from core/common.py to core/missing.py #11462

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

Merged
merged 1 commit into from
Oct 28, 2015

Conversation

stahlous
Copy link
Contributor

This PR moves the routines used for filling missing data into their own module as suggested in PR #11445.

Thoughts on re-naming interpolate_1d() and interpolate_2d()? They way they are currently named makes them sound like they're the same functions for arrays of differing dimensions. However, interpolate_1d() is used for interpolating with scipy interp methods whereas interpolate_2d() is used for forward- or back-filling.

@@ -25,6 +25,8 @@
from pandas.core.categorical import Categorical, maybe_to_categorical
from pandas.tseries.index import DatetimeIndex
import pandas.core.common as com
from pandas.core.missing import (interpolate_1d, interpolate_2d,
_clean_fill_method, _clean_interp_method)
Copy link
Contributor

Choose a reason for hiding this comment

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

you can also so like we do for com, e.g. just import missing (and then access it), might be slightly cleaner

@jreback jreback added the Clean label Oct 28, 2015
@jreback jreback added this to the 0.17.1 milestone Oct 28, 2015
@@ -1420,350 +1420,6 @@ def _fill_zeros(result, x, y, name, fill):
return result


def _interp_wrapper(f, wrap_dtype, na_override=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

you might be able to strip some imports here, you might need a linter to find these though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ran it through PyLint and didn't find any unused imports

Copy link
Contributor

Choose a reason for hiding this comment

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

ok gr8

@jreback
Copy link
Contributor

jreback commented Oct 28, 2015

ok looks good
ping when green

@stahlous
Copy link
Contributor Author

For internals.py and generic.py I switched to the import ... as technique. Both index.py and and categorical.py only import one method, so I left those as from ... import. Will ping when green.

jreback added a commit that referenced this pull request Oct 28, 2015
CLN: move routines for filling missing data from core/common.py to core/missing.py
@jreback jreback merged commit acf0eed into pandas-dev:master Oct 28, 2015
@jreback
Copy link
Contributor

jreback commented Oct 28, 2015

@stahlous thanks! this was great!

let's revisit the naming scheme for these in your other PR.

@stahlous stahlous deleted the missing_reorg branch October 28, 2015 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants