交差点のパフォーマンスを一覧表示これが
すべてのJSLウィザードへの質問。
私はテキストを持っています
さまざまな方法でグループ化する必要があるデータ。
style = "">
私のテーブルは次のようになります。
style = "font-weight:bold; text-decoration:underline; font-family:monospace;">私の
バリューカテゴリー1
カテゴリ2カテゴリ3
style = "font-family:monospace;">
AA
1
1
0
style = "font-family:monospace;">
BB
0
1
0
style = "font-family:monospace;">
CC
1
0
0
style = "font-family:monospace;">
DD
0
1
0
style = "font-family:monospace;">
EE
1
0
0
style = "font-family:monospace;">
FF
0
0
0
style = "font-family:monospace;">
AA
1
1
0
style = "font-family:monospace;">
BB
0
1
0
style = "font-family:monospace;">
GG
0
0
0
style = "font-family:monospace;">
HH
0
0
1
style = "font-family:monospace;">
んん
0
1
1
カテゴリ
列を使用すると、さまざまな方法でデータをグループ化できます。
style = "">ザ
この例のカテゴリは、
次のリスト:
style = "font-size:10pt; font-family:" Courier New "; color:black;">カテゴリ
1
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> =
style = "font-size:10pt; font-family:" Courier New "; color:black;">
{{
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "AA"
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "CC"
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "EE"
style = "font-size:10pt; font-family:" Courier New "; color:black;">}
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;">カテゴリ
2
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> =
style = "font-size:10pt; font-family:" Courier New "; color:black;">
{{
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "AA"
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "BB"
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "DD"
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "MM"
style = "font-size:10pt; font-family:" Courier New "; color:black;">}
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:black;">カテゴリ
3
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:navy;"> =
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:black;">
{{
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:purple;"> "KK"
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:black;">
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:purple;"> "MM"
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:black;">}
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:navy;">;
もしあなたが〜なら
なぜ1つのカテゴリ列を追加しないのか疑問に思います。
ある可能性があるからです
カテゴリリストで重複しています。
したがって、私は
カテゴリごとに個別の列が必要です。
値の場合
の中にMyValue
列が一致する
カテゴリリストの値の場合、カテゴリ列は1です。それ以外の場合は、
0です。
これにより、データの個別の分析を迅速に実行できます
各カテゴリに一致します。
私の問題
カテゴリ列を計算するときのパフォーマンスの1つです。
style = "">これは
小さなテーブル(10,000行、3
カテゴリ、小さなカテゴリリスト)。
style = "">
しかし、それは行き詰まります
より大きなデータセットの場合(300,000行、200
カテゴリ、大きなカテゴリリスト)。
style = "">いくつかの
カテゴリリストの数は非常に大きくなる可能性があります(2000の値)。
基本的に私は
データ間のある種のリスト交差を行うための高速な方法が必要です
の中にMyValue
列とそれぞれのデータ
カテゴリリスト。
これはとても簡単です
例ですが、概念を示しています。
これが
1つのカテゴリに使用しているロジック。
style = "">ザ
を使用してリストと列の間の一致を見つける機能
style = ""> SELECT WHERE
非常に強力です。
なんとかスピードアップできたら
方法を知りたいです!
style = "font-size:10pt; font-family:" Courier New "; color:black;"> one_category
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> =
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "カテゴリ
1 "
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;"> category_list
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> =
style = "font-size:10pt; font-family:" Courier New "; color:black;">
{{
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "AA"
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "CC"
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:purple;"> "EE"
style = "font-size:10pt; font-family:" Courier New "; color:black;">}
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;"> nr
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> =
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:rgb(0、0、221);"> nrows
style = "font-size:10pt; font-family:" Courier New "; color:black;">(
style = "font-size:10pt; font-family:" Courier New "; color:black;"> dt )。
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;"> col_zeroes
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> =
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:rgb(0、0、221);"> j
style = "font-size:10pt; font-family:" Courier New "; color:black;">(
style = "font-size:10pt; font-family:" Courier New "; color:black;"> nr
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:teal;"> 1
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:teal;"> 0
style = "font-size:10pt; font-family:" Courier New "; color:black;">)
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:green;"> //
カテゴリ列を追加します
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;"> dt
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> <<
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:rgb(0、0、221);"> new
桁
style = "font-size:10pt; font-family:" Courier New "; color:black;">(
style = "font-size:10pt; font-family:" Courier New "; color:black;"> one_category
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
数値)。
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:rgb(0、0、221);">列
style = "font-size:10pt; font-family:" Courier New "; color:black;">(
style = "font-size:10pt; font-family:" Courier New "; color:black;"> dt
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
one_category )。
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> <<
style = "font-size:10pt; font-family:" Courier New "; color:black;">
隠れる((
style = "font-size:10pt; font-family:" Courier New "; color:teal;"> 1
style = "font-size:10pt; font-family:" Courier New "; color:black;">)
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:green;"> //
列全体を次のように設定します
最初はゼロ
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:rgb(0、0、221);">列
style = "font-size:10pt; font-family:" Courier New "; color:black;">(
style = "font-size:10pt; font-family:" Courier New "; color:black;"> dt
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
one_category )。
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> <<
style = "font-size:10pt; font-family:" Courier New "; color:black;">
値(( col_zeroes [
style = "font-size:10pt; font-family:" Courier New "; color:teal;"> 0
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:teal;"> 1
style = "font-size:10pt; font-family:" Courier New "; color:black;">])
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:green;"> //
値を持つすべての行を選択します
このカテゴリに一致
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;"> dt
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> <<
style = "font-size:10pt; font-family:" Courier New "; color:black;">
場所を選択((
style = "font-size:10pt; font-family:" Courier New "; color:rgb(0、0、221);">含む
style = "font-size:10pt; font-family:" Courier New "; color:black;">(
style = "font-size:10pt; font-family:" Courier New "; color:black;"> category_list
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:navy;">:
style = "font-size:10pt; font-family:" Courier New "; color:black;">マイ
価値))
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:green;"> //
選択したリストを取得する
行
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;"> one_cat_rows
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> =
style = "font-size:10pt; font-family:" Courier New "; color:black;">
dt
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> <<
style = "font-size:10pt; font-family:" Courier New "; color:black;">
選ばれる
行()
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:green;"> //
一致するすべての行を1に設定します
このカテゴリ
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:rgb(0、0、221);"> if
style = "font-size:10pt; font-family:" Courier New "; color:black;">
((
style = "font-size:10pt; font-family:" Courier New "; color:rgb(0、0、221);"> nrows
style = "font-size:10pt; font-family:" Courier New "; color:black;">(
style = "font-size:10pt; font-family:" Courier New "; color:black;"> one_cat_rows )。
style = "font-size:10pt; font-family:" Courier New "; color:navy;" >>
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:teal;"> 0
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "">
style = "font-size:10pt; font-family:" Courier New "; color:rgb(0、0、221);">列
style = "font-size:10pt; font-family:" Courier New "; color:black;">(
style = "font-size:10pt; font-family:" Courier New "; color:black;"> dt
style = "font-size:10pt; font-family:" Courier New "; color:navy;">、
style = "font-size:10pt; font-family:" Courier New "; color:black;">
one_category )[ one_cat_rows ]
style = "font-size:10pt; font-family:" Courier New "; color:navy;"> =
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; font-family:" Courier New "; color:teal;"> 1
style = "font-size:10pt; font-family:" Courier New "; color:navy;">;
style = "font-size:10pt; font-family:" Courier New "; color:black;">
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:black;">)
style = "font-size:10pt; line-height:115%; font-family:" Courier New "; color:navy;">;