How do you remove rows from tall arrays?

4 ビュー (過去 30 日間)
R
R 2022 年 4 月 4 日
コメント済み: R 2022 年 4 月 5 日
For normal arrays, I would usually use the following code to remove the rows that I did not want.
array(1:100,) = [];
However, I get the following error and can not remove the rows.
For A(m,n,...) = [], m must be either a colon (:) or a tall logical vector.
  2 件のコメント
Stephen23
Stephen23 2022 年 4 月 4 日
Did you try using a tall logical vector?
R
R 2022 年 4 月 5 日
I did not understand how to implement that when deleting the first 100 rows

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

採用された回答

Edric Ellis
Edric Ellis 2022 年 4 月 4 日
As the error message states, the only way to remove specific rows from a tall array is with a logical vector. In other words, the following is valid:
t = tall(rand(100,1));
Starting parallel pool (parpool) using the 'local' profile ... Connected to the parallel pool (number of workers: 2).
t(t < 0.2) = []
t = M×1 tall double column vector 0.9291 0.4580 0.8203 0.9105 0.2477 0.8635 0.5471 0.4856 : :
In your particular case, instead of deleting elements, you can instead simply select the remainder of the array:
t = tall(rand(1000, 1));
t2 = t(101:end)
t2 = M×1 tall double column vector ? ? ? : :

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLarge Files and Big Data についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by