astrodbtoolkit / astrodbtoolkit/AstrodbKit

Add method to pivot results

オープン
#23 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
12
フォーク
5
PR マージ指標
30日以内にマージされた PR はありません

説明

In some situations, we may need to group results and shift values into individual columns.
The example that comes to mind is data sorted like this:
```
name parameter value
source1 C/O ratio 0.1
source1 velocity -2
source1 mass 10
source2 C/O ratio 0.2
source2 mass 1
```
While this is fine, the user may want instead a table of the form:
```
name C/O ratio velocity mass
source1 0.1 -2 10
source2 0.2 None 1
```
This can be done with some group by commands, but we may want to provide a method `.pivot` to handle this automatically for the user, with an option to pass along what column name should be the pivot.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、Python/SQLAlchemyコードベースにある既存の result および group-by クエリAPIを見つけ、現在ユーザーが結果をどのように再構成しているかを確認します。pivotメソッドの列名オプションと、source2 の velocity のような欠損値に対する動作を定義します。サンプルデータが、パラメータ値を列として名前ごとに1行を生成すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python, sqlalchemy
領域
backend-api-design, data, databases
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。