Skip to content
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

pd.lib.infer_dtype infers bytes in Python3 #10032

Merged
merged 2 commits into from
May 8, 2015
Merged

pd.lib.infer_dtype infers bytes in Python3 #10032

merged 2 commits into from
May 8, 2015

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Apr 30, 2015

No description provided.

@cpcloud cpcloud self-assigned this May 1, 2015
@cpcloud cpcloud added this to the 0.16.1 milestone May 1, 2015
@jreback jreback added the Dtype Conversions Unexpected or buggy dtype conversions label May 4, 2015

import pandas as pd
from pandas.lib import isscalar, item_from_zerodim, max_len_string_array
import pandas.util.testing as tm
from pandas.compat import u

PY2 = sys.version_info[0] == 2
Copy link
Contributor

Choose a reason for hiding this comment

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

add this to pandas.compat (or just import PY3)

@jreback
Copy link
Contributor

jreback commented May 5, 2015

ping!

@jreback
Copy link
Contributor

jreback commented May 7, 2015

?

@cpcloud
Copy link
Member Author

cpcloud commented May 7, 2015

@jreback ok with this?

@cpcloud
Copy link
Member Author

cpcloud commented May 7, 2015

oh whoops, need to add tests for strops

@jreback
Copy link
Contributor

jreback commented May 7, 2015

and add to this line: https://github.com/pydata/pandas/blob/master/pandas/core/base.py#L522

(test if you can)

squash as well. thxs

@cpcloud
Copy link
Member Author

cpcloud commented May 7, 2015

ok, in progress

@cpcloud
Copy link
Member Author

cpcloud commented May 7, 2015

hm, so to really be solid about this we'd have to test every single str operation against a bytes series

e.g., cat was failing because it has a sep argument that is '' if None is passed in. That string will be a unicode string in python 3 which can't be used with a bytes object

@cpcloud
Copy link
Member Author

cpcloud commented May 7, 2015

Do we have to support bytes operations? I really just wanted the ability to tell if a Series contained bytes. I wasn't looking to add any new features.

@jreback
Copy link
Contributor

jreback commented May 7, 2015

no I don't think bytes are necessarily a big deal to support - in fact prob should raise on str type ops?

@cpcloud
Copy link
Member Author

cpcloud commented May 7, 2015

ok, i'll test that we raise on str access

@jreback
Copy link
Contributor

jreback commented May 8, 2015

ok, looks good. just add a release note and merge. ty.

cpcloud added a commit that referenced this pull request May 8, 2015
pd.lib.infer_dtype infers bytes in Python3
@cpcloud cpcloud merged commit 8b7c22d into pandas-dev:master May 8, 2015
@cpcloud cpcloud deleted the infer-bytes branch May 8, 2015 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants