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