Reputation: 47
columuns in my data are [Instrument,Account Number,Trade PnL]
How can i find the number of unique account number given with condition that Instrument =='AAPL'
df[['Account Number'](df['Instrument'] == 'AAPL'].nunique()
Upvotes: 0
Views: 32
Reputation: 13349
This should be:
df['Account Number'][df['Instrument'] == 'AAPL'].nunique()
Upvotes: 1