Issue
I am using the below code to iterate through many data frames based on a few keywords. There are 20 data frames and about 30 columns. I am not able to append each data frame to create a list of data frames. Any suggestions would be helpful.
out=[]
for df in dfs:
out.append(df.filter(regex=r"key|words|find(?=[^\d]|$)"))
Solution
This may work. Please let me know if there is a better way to make it work.
out=[]
for df in dfs:
filtered=df.filter(regex=r"key|words|find(?=[^\d]|$)")
out.append (filtered)
Answered By - yeppi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.