Skip to content

PERF: Fixed decoding perf issue on py3 (GH5441) #5448

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
Nov 6, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Nov 6, 2013

closes #5441

f = np.vectorize(lambda x: x.decode(encoding), otypes=[np.object])
data = f(data)
try:
data = data.astype(str).astype(object)
Copy link
Contributor

Choose a reason for hiding this comment

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

So this branch works when you only have ascii letters/numbers in your output? Otherwise always needs to be decoded, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no it always works with an individual decoding, just slow. the astyping to str works when the input can be safely decoded by the astype(str) (which is prob just a UTF-8 decode on numpy side thats in c)

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay (I meant the astyping line) sounds good.

jreback added a commit that referenced this pull request Nov 6, 2013
PERF: Fixed decoding perf issue on py3 (GH5441)
@jreback jreback merged commit 764b444 into pandas-dev:master Nov 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HDFStore.select slowed by decode even when using columns=
2 participants