Transforms like 'scale' need some way to handle missing data
还没有人认领这个 Issue。
评估
调研方向
该 issue 提供了一个可复现的 pandas DataFrame 和 pt.dmatrices 示例;首先运行 scale(X.diff()) 这一情况,并将其与 X.diff() 进行比较。跟踪变换产生的缺失值是如何处理的,并将完成定义为该表达式能够得到不导致崩溃的结果。
由索引模型根据 Issue 内容生成。
描述
In[92]: df = pd.DataFrame([(1,3),(2,6),(4,2),(6,5),(7,3),(4,6),(2,2),(6,4)], columns=['y','X'])
In[93]: pt.dmatrices('y ~ X.diff()', df)
Out[93]:
(DesignMatrix with shape (7, 1)
y
2
4
6
7
4
2
6
Terms:
'y' (column 0),
DesignMatrix with shape (7, 2)
Intercept X.diff()
1 3
1 -4
1 3
1 -2
1 3
1 -4
1 2
Terms:
'Intercept' (column 0)
'X.diff()' (column 1))
In[94]: pt.dmatrices('y ~ scale(X.diff())', df)
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\IPython\core\formatters.py", line 222, in catch_format_error
r = method(self, *args, **kwargs)
File "C:\Python34\lib\site-packages\IPython\core\formatters.py", line 699, in __call__
printer.pretty(obj)
File "C:\Python34\lib\site-packages\IPython\lib\pretty.py", line 368, in pretty
return self.type_pprinters[cls](obj, self, cycle)
File "C:\Python34\lib\site-packages\IPython\lib\pretty.py", line 552, in inner
p.pretty(x)
File "C:\Python34\lib\site-packages\IPython\lib\pretty.py", line 382, in pretty
return meth(obj, self, cycle)
File "C:\Python34\lib\site-packages\patsy\design_info.py", line 1089, in _repr_pretty_
for col in formatted_cols]
File "C:\Python34\lib\site-packages\patsy\design_info.py", line 1089, in <listcomp>
for col in formatted_cols]
ValueError: max() arg is an empty sequence
Out[94]:
- 主要语言
- 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 小时 新手友好度 64/100
维护者通常 1 天内回复
-
area:cli area:security enhancement priority:medium size:small
难度 2/5 1-3 小时 新手友好度 76/100
RonaldHensbergen/composable-data-stack#1338 ·
维护者通常 1 天内回复
-
area:stdlib effort:S impact:med platform:linux type:bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
automated endpoint-dead needs-curation
难度 2/5 1-3 小时 新手友好度 76/100
almanac-data/climate-almanac#139 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
UKGovernmentBEIS/inspect_ai#6695 · 1 条评论 ·
维护者通常 1 天内回复