import pandas as pd
df = pd.read_csv("path", sep = " ")
newdf = df.loc[:,:].isin(["(#10)","#9","Automation","Create","log"])
print(newdf)
This is my code. I have a big logfile where I want to look for different error codes ["(#10)","#9","Automation","Create","log"] in the whole file.
The file has 16124 rows and 70 columns. The code itself works, but the problem I have is that the output is only "True" and "False". I want the output to be the actual words from the file. Can anyone help me?
The poutput I get is:
1 2 3 4 5 6 7 8 ...
0 False False False False True False False False ...
1 False False False False False False False False ...
2 False False False False False False False False ...
3 False False False False False False False True...
[16124 rows x 70 columns]
The output I want it all rows with the error codes in every column.
1 2 3 4 5 6 7 8 ...
3 2022-06-21 14:20:25 65891 DEBUG Concern #8 nonlog ...
8 2022-06-21 14:20:25 65891 INFO Automation #8 nonlog ...
71 2022-06-21 14:20:25 65891 INFO Concern #9 nonlog ...
358 2022-06-21 14:20:25 65891 INFO Concern #8 log ...
[4 rows x 70 columns]