Efficiently importing data into a table based on a matching column value
1 回表示 (過去 30 日間)
古いコメントを表示
I have two large data tables. Each table has a column with a unique code representing the same event analyzed by two different pieces of software. Not all codes are present on both tables.
What I want to do is find rows in which the event in Table A matches the event code in Table B, and put other data from those matching rows alongside the data in tableA.
On a smaller scale, I've used something in the form of:
for q = 1:height(tableA)
for r = 1:height(tableB)
if tableA.frame(q) == tableB.frame(r)
tableA.data(q) = tableB.data(r);
end
end
end
Searching and replacing row-by-row is far too inefficient to use at scale and I'm sure there must be a better way, but since the tables are different sizes and each contains codes that aren't present on the other, I'm not sure how to do this via indexing in MATLAB.
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!