How to use or in pandas and datetime
Yoben's answer is correct and complete, but a note: 6|7|8\9 is always true, and unless you have True in your column, this will do nothing.
So, I'm building a model and trying to use | for a new column and I'm confused as to what I'm doing wrong. It's supposed to make a new column and type 1 when the value is true.

For example, this worked : 
feature_matrix["After 2016"] = (feature_matrix.index.year > 2016).astype(int)
However this does nothing :
feature_matrix["Summer"] = (feature_matrix.index.month == 6|7|8|9).astype(int)
Same thing goes for this when I try to do the weekend using the same method.

I tried solving it using : 
feature_matrix["Summer"] = (feature_matrix.index.month == 6| feature_matrix.index.month == 7).astype(int)
But that gives me : unsupported operand type(s) for |: 'int' and 'Int64Index'