Skip to content

indexes as ordered set - issue in code #380

Open
@maxvolpi

Description

@maxvolpi

I am trying to reproduce the code on page 107 of the first edition (and it is the same on Github).
When I do indA & indB I get a strange result: [0,3,5, 7,9] while if I use the code set(indA) & set(indB) I get the expected result
{3,5,7}. I also get the same correct result if I use the method indA.intersection(indB).

Likewise, I get funny results with | and ^. while the equivalent set operations and the methods all work.

It is not clear why this is happening, as I have tried it from scratch a few times, to avoid typos

Activity

steve-edward

steve-edward commented on Aug 26, 2024

@steve-edward

Hey , can you please specify the section?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      indexes as ordered set - issue in code · Issue #380 · jakevdp/PythonDataScienceHandbook