Categorical does not work with nan
还没有人认领这个 Issue。
评估
调研方向
首先使用所示值复现报告的 C(col_name) 行为,然后尝试 Treatment(reference=nan) 并检查产生的异常。跟踪公式处理期间如何识别分类水平和缺失值。完成的标准是:分类项创建四个哑变量,并且可以将 nan 选为参考水平而不会出现报告中的错误。
由索引模型根据 Issue 内容生成。
描述
I have a columns whose unique looks like:
array([nan, 'CONFERENCE', 'ANALYST', 'FORUM', 'SEMINAR'], dtype=object)
I would expect that adding C(col_name) to the formula would create 4 dummy variables (5 values-1), bu in fact it only adds 3.
When I tried to explicitly set control to be nan, i get an exception:
C(col_name, Treatment(reference=nan))
PatsyError: specified level nan not found
- 主要语言
- 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 天内回复