how to deal with unicode?
还没有人认领这个 Issue。
评估
调研方向
首先,使用 issue 中所示的 Unicode 公式和 DataFrame 键,在入口点 patsy.dmatrices 复现所报告的失败。检查公式和数据键的处理方式,然后确定该问题是通过记录一项建议来解决,还是需要为受影响的入口点定义编码支持。
由索引模型根据 Issue 内容生成。
描述
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?
- 主要语言
- Python
- 星标
- 990
- 派生
- 113
- 平均合并
- 2 天 8 小时
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pydata/patsy 的其他 Issue
-
VarLookupDict should implement __iter__, causes CPython crash when using statsmodels in marimo notebook可能已有人在做 @kouyouqi123 于 173 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
Add link to license in readme可能已有人在做 @zheng-guannan577 于 9 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 68/100
-
Nullable pandas dtypes crash in categorical handling: "Cannot interpret 'BooleanDtype' as a data type"可能已有人在做 @RaphaelFakhri 于 15 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
-
cc() truncates periodic coordinates for integer input with fractional bounds可能已有人在做 @ktz03 于 39 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
abetlen/llama-cpp-python#2424 ·
维护者通常 1 天内回复
-
Bug IronPython Python 3
难度 2/5 1-3 小时 新手友好度 72/100
pyrevitlabs/pyRevit#4184 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 74/100
jqueryscript/awesome-claude-code#1009 ·
-
tests
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复