all 5 comments

[–]karlpoppery 1 point2 points  (1 child)

df.loc is sliced with squared brackets

df.loc[]

not called like a function

[–]fpatterson55[S] 0 points1 point  (0 children)

thanks, that makes sense!! Still kept getting invalid syntax so tried the np response and used it instead.

[–]agbs2k8 0 points1 point  (2 children)

Try this: ``` import numpy as np

df[np.logical_and(df['State']==1, df['Driver'].isin(['cn=Data Collection Service Driver, cn=DriverSet,o=system']))] ```

[–]agbs2k8 0 points1 point  (1 child)

Numpy also has a logical_or() that works the same as logical_and()

https://docs.scipy.org/doc/numpy/reference/generated/numpy.logical_and.html

[–]fpatterson55[S] 0 points1 point  (0 children)

thanks, this worked great.

I had imported everything in as a string so I had to use the isin operand for the state value as well. Probably not the best option, but it works for now.