how to deal with unicode?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reproducing the reported failure at the patsy.dmatrices entry point with the Unicode formula and DataFrame keys shown in the issue. Inspect how the formula and data keys are handled, then establish whether the issue is resolved by documenting a recommendation or by defining encoding support for the affected entry points.
Written by the indexing model from the issue text.
Description
Dealing with just Python 2 for now, I understand that patsy expects strings. But the data containers might not have this design. So what's the recommended way for handling this? Should we be messing with the data keys under the hood, or should patsy? The only way I can think to handle this (other than statsmodels doing it under the hood) is for patsy to accept unicode but also an encoding so the formula and they data keys can both be encoded correctly. E.g., this fails
import pandas as pd
import patsy
data = pd.DataFrame({
u'àèéòù' : np.random.randn(100),
'x' : np.random.randn(100)})
formula = u"Q('àèéòù') ~ x".encode('utf-8')
dmatrices = patsy.dmatrices(formula, data=data)
But if we also encode the data keys, it's fine. So should dmatrices and whatever other entry points also take an encoding? Am I missing something?
- Dominant language
- Python
- Stars
- 990
- Forks
- 113
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pydata/patsy
-
VarLookupDict should implement __iter__, causes CPython crash when using statsmodels in marimo notebookPossibly taken @kouyouqi123 claimed this 173 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Add link to license in readmePossibly taken @zheng-guannan577 claimed this 9 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Nullable pandas dtypes crash in categorical handling: "Cannot interpret 'BooleanDtype' as a data type"Possibly taken @RaphaelFakhri claimed this 15 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
cc() truncates periodic coordinates for integer input with fractional boundsPossibly taken @ktz03 claimed this 39 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
abetlen/llama-cpp-python#2424 ·
Maintainers usually reply within 1 day
-
Bug IronPython Python 3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyrevitlabs/pyRevit#4184 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100
jqueryscript/awesome-claude-code#1009 ·
-
tests
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day