I\'m trying to identify all the options contracts for MSFT and GOOG that have over 10,000 in volume for the day and to print out the name of the symbol.I am getting the error \"
The problem is that the condition (data.Vol > 10000
) returns an array of boolean values. NumPy emits that error because it can't know whether you mean to ask "are any of these values > x
?", "are all of these values > x
?", etc.
In this case you should use logical indexing to get the rows you're interested in: data[data.Vol > 10000]
.
From there, you can get all the relevant symbols: data[data.Vol > 10000].index.get_level_values('Symbol')