Home > other >  How to determine whether a column contains a list of dataframe string?
How to determine whether a column contains a list of dataframe string?

Time:03-24

For example, target=[' A2001 ', 'B2002]
The data1={
"A" : "CU2001C50000 XSGE", 'CU2002C49000. XSGE', 'CU2003C52000. XSGE', 'D2004P49000. 3366],
"B" :,5,6,8 [4],
"C" :,8,9,5 [7]
}
Df=pd DataFrame (data1)
The column a part of the data contained in the target string
How to select a column contains a target string in the df line?
Don't use cycle in the target, I want to use only the dataframe related operations to extract.
In addition, do not use startwith, because the list of strings may appear in any position of a kind of data.
  • Related