Getting row id of data

4 ビュー (過去 30 日間)
Sarmed Wahab
Sarmed Wahab 2022 年 6 月 5 日
コメント済み: Walter Roberson 2022 年 6 月 6 日
I have a large data set of over 22 lac rows. This data comprises of 251 zones in Washington and out of these zones I am interested in only 30 zones. I used groupsummary to get the frequency of occurance of the a specific zone.
groupsummary(data,"PickupZone")
Now I want to get the row id of a specific PickupZone, for that I require some help on how to get the row id of every occurance of Astoria.
Then I will use that row id to assign a new variable in table for the regions comprising of those zones.
  1 件のコメント
Stephen23
Stephen23 2022 年 6 月 5 日

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2022 年 6 月 5 日
Let T be your table. And you want to seperate Astoria from T into another table T1.
idx = strcmp(T.PickupZone,'Astoria') ;
T1 = T(idx,:) ;
  3 件のコメント
Sarmed Wahab
Sarmed Wahab 2022 年 6 月 6 日
Thanks for the help, I have figured out how to get his done.
t3 = ismember(taxi_all.PickupZone, {'Alphabet City','Astoria'})
this returns 1 at the place of occurance of these values.
from there I can replace those 1's with the region name.
Walter Roberson
Walter Roberson 2022 年 6 月 6 日
taxi_all.RegionName(idx)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeApp Building についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by