-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
cleanup inconsistently used imports #19292
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
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b6cb055
cleanup inconsitently used imports
jbrockmendel e87a9fb
Add linting for com, implement over all files
jbrockmendel 1f373c3
Merge branch 'master' of https://github.com/pandas-dev/pandas into us…
jbrockmendel 7872f33
revert whitespace changes
jbrockmendel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,7 @@ | |
from pandas.core.dtypes.inference import is_hashable | ||
from pandas.core.dtypes.missing import isna, notna | ||
from pandas.core.dtypes.generic import ABCSeries, ABCPanel, ABCDataFrame | ||
from pandas.core.common import (_count_not_none, | ||
_maybe_box_datetimelike, _values_from_object, | ||
AbstractMethodError, SettingWithCopyError, | ||
from pandas.core.common import (AbstractMethodError, SettingWithCopyError, | ||
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. this is inconsistent with your change |
||
SettingWithCopyWarning) | ||
|
||
from pandas.core.base import PandasObject, SelectionMixin | ||
|
@@ -1026,7 +1024,7 @@ def _indexed_same(self, other): | |
for a in self._AXIS_ORDERS) | ||
|
||
def __neg__(self): | ||
values = _values_from_object(self) | ||
values = com._values_from_object(self) | ||
if values.dtype == np.bool_: | ||
arr = operator.inv(values) | ||
else: | ||
|
@@ -1035,7 +1033,7 @@ def __neg__(self): | |
|
||
def __invert__(self): | ||
try: | ||
arr = operator.inv(_values_from_object(self)) | ||
arr = operator.inv(com._values_from_object(self)) | ||
return self.__array_wrap__(arr) | ||
except Exception: | ||
|
||
|
@@ -1490,7 +1488,7 @@ def __round__(self, decimals=0): | |
# Array Interface | ||
|
||
def __array__(self, dtype=None): | ||
return _values_from_object(self) | ||
return com._values_from_object(self) | ||
|
||
def __array_wrap__(self, result, context=None): | ||
d = self._construct_axes_dict(self._AXIS_ORDERS, copy=False) | ||
|
@@ -2696,7 +2694,7 @@ def xs(self, key, axis=0, level=None, drop_level=True): | |
# that means that their are list/ndarrays inside the Series! | ||
# so just return them (GH 6394) | ||
if not is_list_like(new_values) or self.ndim == 1: | ||
return _maybe_box_datetimelike(new_values) | ||
return com._maybe_box_datetimelike(new_values) | ||
|
||
result = self._constructor_sliced( | ||
new_values, index=self.columns, | ||
|
@@ -3557,7 +3555,7 @@ def filter(self, items=None, like=None, regex=None, axis=None): | |
""" | ||
import re | ||
|
||
nkw = _count_not_none(items, like, regex) | ||
nkw = com._count_not_none(items, like, regex) | ||
if nkw > 1: | ||
raise TypeError('Keyword arguments `items`, `like`, or `regex` ' | ||
'are mutually exclusive') | ||
|
@@ -6357,7 +6355,7 @@ def _where(self, cond, other=np.nan, inplace=False, axis=None, level=None, | |
if try_quick: | ||
|
||
try: | ||
new_other = _values_from_object(self).copy() | ||
new_other = com._values_from_object(self).copy() | ||
new_other[icond] = other | ||
other = new_other | ||
except Exception: | ||
|
@@ -7318,7 +7316,7 @@ def pct_change(self, periods=1, fill_method='pad', limit=None, freq=None, | |
rs = (data.div(data.shift(periods=periods, freq=freq, axis=axis, | ||
**kwargs)) - 1) | ||
if freq is None: | ||
mask = isna(_values_from_object(self)) | ||
mask = isna(com._values_from_object(self)) | ||
np.putmask(rs.values, mask, np.nan) | ||
return rs | ||
|
||
|
@@ -7778,7 +7776,7 @@ def cum_func(self, axis=None, skipna=True, *args, **kwargs): | |
else: | ||
axis = self._get_axis_number(axis) | ||
|
||
y = _values_from_object(self).copy() | ||
y = com._values_from_object(self).copy() | ||
|
||
if (skipna and | ||
issubclass(y.dtype.type, (np.datetime64, np.timedelta64))): | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
extras here