I created a dataframe from text files (very irregular from each other). I created a boolean array of all the strings that start with 'T-', using below 'masking'.
mask = np.column_stack([amadeus[col].str.startswith(r'T-', na=False) for col in amadeus])
Below you may see the dataframe (left) and the boolean matches of my 'masking'.
I have been trying to manage the irregularity of the files with dicts, etc. with no success.
What I really need is to use this masking to 'pull' the actual contents of the cells marked as 'True' into a dataframe. Something like:
This is just and intermediate step to other transformations I need to do. Editing it, because it was wrongly tagged as duplicate.