필터 지우기
필터 지우기

Rowfilter option in datastore to search for specific pattern in strings

조회 수: 18 (최근 30일)
Surya Kandukuri
Surya Kandukuri 2023년 9월 24일
댓글: Simon Sigl 2023년 10월 25일
I have a large parquest datastore with several files consisting several rows and four columns. One of these columns have strings of long names. I'd like to extract all of those names that contain a specific pattern, eg:'OS.V' . Normally, i use contains(df.column_C, 'OS.V'), to get the list. But within filter, this throws an error. Is there another way to approach this? Thanks
df.rowfilter = c; c = (df.column_C=="TUB1.OS.V"); %this gives that specific tag%
%but not this%
c = contains(df.column_C, 'OS.V'); % I'd like to extract "TUB1.OS.V", "M.TUB2.OS.V",...
  댓글 수: 1
Simon Sigl
Simon Sigl 2023년 10월 25일
Similar problem here. I would like to specify a filter condition based on a list/set:
aTable = (some tall array);
ids2Filter = ["id1", "id2"];
rf = rowfilter(aTable);
rf2 = rowfilter(ismember(rf.id, ids2Filter)) %ismember does not accept rowfilter
how can this be done?

댓글을 달려면 로그인하십시오.

답변 (1개)

Pratyush
Pratyush 2023년 9월 25일
Hi Surya,
I understand that you want to filter rows from your datastore which have a specific pattern for a given column.
Modify your code in the following manner to use contains:
checkPattern = @(str) contains(str, 'OS.V');
c = @(df) checkPattern(df.column_C);
  댓글 수: 2
Surya Kandukuri
Surya Kandukuri 2023년 10월 2일
Umm.. that doesnt seem to work either...
Error using reconstructAfterSettingImportOptions
Expected RowFilter to be one of these types:
matlab.io.RowFilter
Instead its type was function_handle.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by