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

NE3: Byte and Unicode string support #263

Closed
robbmcleod opened this issue Mar 14, 2017 · 3 comments
Closed

NE3: Byte and Unicode string support #263

robbmcleod opened this issue Mar 14, 2017 · 3 comments
Labels

Comments

@robbmcleod
Copy link
Member

NE2 had very limited support for ascii-encoded strings (with the contains function and comparisons). Likely additional function could be added to NE3 if someone who does string processing could be found to implement them.

The main question is how to interact with the Python Unicode object, and how to get the byte-depth used (i.e. UTF-8 versus UTF-16 versus UTF-32).

@zorion
Copy link

zorion commented Dec 13, 2019

I guess you already have one, but in case you need a small test for python3:

import numexpr as ne

data_text = {'a': 'b'}
data_byte = {'a': b'b'}
condition = "(a=='a')"

try:
    r_text = ne.evaluate(condition, data_text)
except Exception as error:
    print('Exception when text', error)

r_byte = ne.evaluate(condition, data_byte)
print('Byte version', r_byte)

This code prints:

Exception when text unknown type str32
Byte version False

It fails when trying using python3's string but it works for byte.
I also notice that we don't need the byte version for the condition (paramter ex).

@josedaniel-escribano-clarity

Hi is this planned to be released? Very intested in the unicode support

Copy link

Message to comment on stale issues. If none provided, will not mark issues stale

@github-actions github-actions bot added the Stale label Mar 13, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants