Applying formats to compued vars
還沒有人認領這個 Issue。
評估
研究方向
首先,使用 CASTable、computedvars、columnInfo() 以及經過篩選的 head() 呼叫執行所提供的 Python 重現程式。追蹤將格式套用至計算出的時間欄位後對後續資料表操作的影響,並在保留該格式且依據 price 篩選 tbl 仍能成功執行時,將此問題視為已完成。
由索引模型根據 Issue 內容生成。
描述
Hi,
it would be very helpful if formats could be applied to computed variables - especially when working with date/time columns. The functionality seems to be there, but it's breaking the table reference.
Example: Based on a datetime column I can successfully add a time column that holds the hour of the datetime column.
# example table
conn.datastep.runCode(
code =
'''data test;
format datetime e8601dt19.;
datetime = dhms("03mar2024"d, 9, 50, 0);
price = 101.4;
output;
datetime = dhms("03mar2024"d, 10, 20, 0);
price = 102.5;
output;
run;''',
single = 'yes'
)
tbl = conn.CASTable('test')
# add column containing the hour of the datetime column
tbl['time'] = tbl['datetime'].dt.hour*60*60
# apply time format to new column
tbl.computedvars = [{'name':'time', 'format':'time8.'}]
# check if time format was applied
tbl.columnInfo()
# check if time format works
tbl.head()
Unfortunately, after applying the format as shown above, I can't execute any operations on the table anymore:
tbl[tbl['price']>=102].head()
- 主要語言
- Python
- 星號
- 159
- 分支
- 66
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
sassoftware/python-swat 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 30/100
sassoftware/python-swat#191 · 1 則留言 ·
-
難度 3/5 1-2 天 新手友好度 35/100
sassoftware/python-swat#183 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 25/100
sassoftware/python-swat#180 ·
-
難度 2/5 1-3 小時 新手友好度 35/100
sassoftware/python-swat#178 ·
-
難度 4/5 3-5 天 新手友好度 25/100
sassoftware/python-swat#177 · 1 則留言 ·
查看 sassoftware/python-swat 的全部 Issue
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 88/100
aws-samples/sample-per-model-bedrock#782 ·
維護者通常 1 天內回覆
-
Google text documents are base64-encoded twice可能已有人在做 @feiiiiii5 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
coveragepy/coveragepy#2364 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 72/100