Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. failed_runs_finder = re.compile(r'FAILEDRuns_') # I want to perform the operations on the dataframes which match this pattern.
  2. list_dfs = list(filter(failed_runs_finder.findall, dir())) # this will get me the list with the names of the dataframes
  3.  
  4. ['FAILEDRuns_0112',
  5. 'FAILEDRuns_0121',
  6. 'FAILEDRuns_0126',
  7. 'FAILEDRuns_0129',
  8. 'FAILEDRuns_0131',
  9. 'FAILEDRuns_0134',
  10. 'FAILEDRuns_0135',
  11. 'FAILEDRuns_0137',
  12. 'FAILEDRuns_0142',
  13. 'FAILEDRuns_0153',
  14. 'FAILEDRuns_0165',
  15. 'FAILEDRuns_0171',
  16. 'FAILEDRuns_0175']
  17.  
  18. for i in list_dfs:
  19. print(getattr(i, 'shape'))
  20.  
  21. AttributeError: 'str' object has no attribute 'shape'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement