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
- 派生
- 65
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 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
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
zostera/django-bootstrap4#894 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
use-agent-os/agent-os#3276 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
难度 2/5 1-3 小时 新手友好度 88/100
NousResearch/hermes-agent#117848 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
zilliztech/memsearch#759 ·