PythonDataScienceHandbook
PythonDataScienceHandbook copied to clipboard
Bitwise operators are conflated with intersection, union, symmetric difference operators in NB 03.01
In the Section "Index as ordered Set", Bitwise operators are mistakenly equated with Set Operators: intersection, union, symmetric difference.
indA = pd.Index([1, 3, 5, 7, 9])
indB = pd.Index([2, 3, 5, 7, 11])
indA.intersection(indB)
Index([3, 5, 7], dtype='int64')
indA & indB # intersection (actually binary AND)
Index([0, 3, 5, 7, 9], dtype='int64')
Not a big deal, but confusing.
Thank you for your book.