フィルターのクリア

Read a datastore by logical groups

1 回表示 (過去 30 日間)
Stepp Gyogi
Stepp Gyogi 2020 年 8 月 19 日
コメント済み: Mohammad Sami 2020 年 9 月 3 日
Currently, I have been able to load a tabularTextDatastore which contains about 4 year's worth of daily data for a bunch of uniquely identified products. These products have unique keys, and the export I did from the database sorts the data by key, date. Therefore, the first (say) 1000 lines will be for product 1, the next (say) 800 for product 2, etc. As you notice in my example, products don't necessarily all have data for all days, therefore I cannot read this datastore by constant chunks of N rows (which I have found in the documentation is possible).
Question: is there an easy or better way to read the data by chunks which correspond to the key which is one of the variables in the datastore?
PS: my DIY way around this would be to read by N rows, such that N is greater than the number of days for any product, and then only select the lines corresponding to a given product. This is awkward at best as it requires bookkeeping where your pointer to the last relevant row is, so I'm hoping this is not the answer.
  1 件のコメント
Mohammad Sami
Mohammad Sami 2020 年 9 月 3 日
If you are trying to calculate group statistics, you may convert the datastore into tall array and then use the groupsummary function.
(see limitation of group summary for tall arrays at the end of the documentation)

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeBig Data Processing についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by