Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- failed_runs_finder = re.compile(r'FAILEDRuns_') # I want to perform the operations on the dataframes which match this pattern.
- list_dfs = list(filter(failed_runs_finder.findall, dir())) # this will get me the list with the names of the dataframes
- ['FAILEDRuns_0112',
- 'FAILEDRuns_0121',
- 'FAILEDRuns_0126',
- 'FAILEDRuns_0129',
- 'FAILEDRuns_0131',
- 'FAILEDRuns_0134',
- 'FAILEDRuns_0135',
- 'FAILEDRuns_0137',
- 'FAILEDRuns_0142',
- 'FAILEDRuns_0153',
- 'FAILEDRuns_0165',
- 'FAILEDRuns_0171',
- 'FAILEDRuns_0175']
- for i in list_dfs:
- print(getattr(i, 'shape'))
- AttributeError: 'str' object has no attribute 'shape'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement