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 天內回覆