sassoftware / sassoftware/python-swat
Applying formats to compued vars
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 159
- フォーク
- 65
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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()
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、CASTable、computedvars、columnInfo()、およびフィルターされた head() 呼び出しを使用して、提供されている Python の再現コードを実行します。計算された時間列にフォーマットを適用することが、その後のテーブル操作にどのような影響を与えるかを追跡し、フォーマットが保持されたまま、price による tbl のフィルタリングが正常に実行されれば、この問題は完了したものとします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api, data
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100