-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: replace of numeric by string / dtype coversion (GH15743) #15812
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
Changes from all commits
676a4e5
e12bca7
9fc617b
8b463cb
080c71e
e62763c
97e1f18
0a98557
45e67e4
73805ce
bd31b2b
e6e4971
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Release Notes | ||
============= | ||
|
||
The list of changes to pandas between each release can be found | ||
The list of changes to Pandas between each release can be found | ||
[here](http://pandas.pydata.org/pandas-docs/stable/whatsnew.html). For full | ||
details, see the commit logs at http://github.com/pandas-dev/pandas. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,16 @@ | |
|
||
from pandas.compat import range, string_types | ||
from pandas.types.common import (is_numeric_v_string_like, | ||
is_float_dtype, is_datetime64_dtype, | ||
is_datetime64tz_dtype, is_integer_dtype, | ||
_ensure_float64, is_scalar, | ||
needs_i8_conversion, is_integer) | ||
is_float_dtype, | ||
is_datetime64_dtype, | ||
is_datetime64tz_dtype, | ||
is_integer_dtype, | ||
is_scalar, | ||
is_integer, | ||
needs_i8_conversion, | ||
_ensure_float64) | ||
|
||
from pandas.types.cast import infer_dtype_from_array | ||
from pandas.types.missing import isnull | ||
|
||
|
||
|
@@ -21,11 +27,11 @@ def mask_missing(arr, values_to_mask): | |
Return a masking array of same size/shape as arr | ||
with entries equaling any member of values_to_mask set to True | ||
""" | ||
if not isinstance(values_to_mask, (list, np.ndarray)): | ||
values_to_mask = [values_to_mask] | ||
dtype, values_to_mask = infer_dtype_from_array(values_to_mask) | ||
|
||
try: | ||
values_to_mask = np.array(values_to_mask, dtype=arr.dtype) | ||
values_to_mask = np.array(values_to_mask, dtype=dtype) | ||
|
||
except Exception: | ||
values_to_mask = np.array(values_to_mask, dtype=object) | ||
|
||
|
@@ -409,7 +415,7 @@ def interpolate_2d(values, method='pad', axis=0, limit=None, fill_value=None, | |
if axis != 0: # pragma: no cover | ||
raise AssertionError("cannot interpolate on a ndim == 1 with " | ||
"axis != 0") | ||
values = values.reshape(tuple((1, ) + values.shape)) | ||
values = values.reshape(tuple((1,) + values.shape)) | ||
|
||
if fill_value is None: | ||
mask = None | ||
|
@@ -447,7 +453,6 @@ def wrapper(arr, mask, limit=None): | |
|
||
|
||
def pad_1d(values, limit=None, mask=None, dtype=None): | ||
|
||
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. normally don't like to edit think not-associated with the PR (e.g. you may have some editor setting which change this)...no big deal 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. Ok... Sorry for that... I'm using IntelliJ IDEA, and it formatted all file with PEP8 standard 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. no problem. we dont' quite follow PEP8 (as flake8 doesn't actually)...... |
||
if dtype is None: | ||
dtype = values.dtype | ||
_method = None | ||
|
@@ -472,7 +477,6 @@ def pad_1d(values, limit=None, mask=None, dtype=None): | |
|
||
|
||
def backfill_1d(values, limit=None, mask=None, dtype=None): | ||
|
||
if dtype is None: | ||
dtype = values.dtype | ||
_method = None | ||
|
@@ -498,7 +502,6 @@ def backfill_1d(values, limit=None, mask=None, dtype=None): | |
|
||
|
||
def pad_2d(values, limit=None, mask=None, dtype=None): | ||
|
||
if dtype is None: | ||
dtype = values.dtype | ||
_method = None | ||
|
@@ -528,7 +531,6 @@ def pad_2d(values, limit=None, mask=None, dtype=None): | |
|
||
|
||
def backfill_2d(values, limit=None, mask=None, dtype=None): | ||
|
||
if dtype is None: | ||
dtype = values.dtype | ||
_method = None | ||
|
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.
FYI for the future if you put this somewhere in the Bug Fixes section , rather than the end you won't have merge conflicts. (we have blank lines for this purpose)