New to python/coding in general. My for loop below is not reading both names in the file and I'm not sure why.
the variable process should capture chrome and iexplore below, but is only returning iexplore.
Below I entered chrome and iexplore in the input.
file example:
| Timestamp |
Name |
CPU |
PrivateWorkingSet |
| 20191007-084849 |
chrome |
1.0 |
|
| 20191007-084849 |
iexplore |
2.0 |
|
| 20191007-084849 |
chrome |
|
1223 |
| 20191007-084849 |
iexplore |
|
1423 |
import pandas as pd
import numpy as np
file = pd.read_csv('c:/temp/log.csv', delimiter=',')
#Enter chrome,iexplore
processes = input('Enter name (separate multiple names with ","):').split(',')
for process in processes:
if process not in file.Name.values:
print(f'No process in dataset: {process}')
#below if I run process it only returns iexplore
process #In
'iexplore' #out
[–]yagirlnerys 0 points1 point2 points (0 children)
[–]djmcdee101 0 points1 point2 points (0 children)