Skip to content

BUG: to_numeric should raise if input is more than one dimension #11776 #11780

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
Dec 10, 2015

Conversation

mortada
Copy link
Contributor

@mortada mortada commented Dec 7, 2015

closes #11776

elif getattr(arg, 'ndim', None) == 1:
pass
else:
raise TypeError('arg must be a list, tuple, 1-d array, or Series')
Copy link
Contributor

Choose a reason for hiding this comment

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

fix the doc-string to match this

@jreback
Copy link
Contributor

jreback commented Dec 7, 2015

pls add a whats new note (you can do in bug fixes)

@jreback jreback added API Design Error Reporting Incorrect or improved errors from pandas labels Dec 7, 2015
@jreback jreback added this to the 0.18.0 milestone Dec 7, 2015
@mortada mortada force-pushed the to_numeric_should_raise_on_df branch from a7ab458 to db3994b Compare December 7, 2015 16:43
@@ -37,7 +37,7 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise', coerce=None):

def _convert_listlike(arg, box, unit, name=None):

if isinstance(arg, (list,tuple)) or ((hasattr(arg,'__iter__') and not hasattr(arg,'dtype'))):
if isinstance(arg, (list, tuple)) or not hasattr(arg, 'dtype'):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note that there's no need to check hasattr(arg,'__iter__') because is_list_like already checks for that

Copy link
Contributor

Choose a reason for hiding this comment

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

np

@mortada mortada force-pushed the to_numeric_should_raise_on_df branch 2 times, most recently from bd9f25a to a44f8be Compare December 8, 2015 06:52
@mortada
Copy link
Contributor Author

mortada commented Dec 9, 2015

@jreback it's updated

@mortada mortada force-pushed the to_numeric_should_raise_on_df branch from a44f8be to dc2a5b3 Compare December 9, 2015 17:06
@mortada
Copy link
Contributor Author

mortada commented Dec 9, 2015

@jreback @jorisvandenbossche updated again

@mortada
Copy link
Contributor Author

mortada commented Dec 10, 2015

travis is green now

jreback added a commit that referenced this pull request Dec 10, 2015
BUG: to_numeric should raise if input is more than one dimension #11776
@jreback jreback merged commit fbb09f4 into pandas-dev:master Dec 10, 2015
@jreback
Copy link
Contributor

jreback commented Dec 10, 2015

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd.to_numeric produces misleading results on DataFrame
3 participants