Skip to content

Conversation

@bkamins
Copy link
Member

@bkamins bkamins commented Dec 4, 2022

Small improvements based on user feedback

@bkamins bkamins requested a review from nalimilan December 4, 2022 15:07
@bkamins bkamins added the doc label Dec 4, 2022
@bkamins bkamins modified the milestones: 1.5, patch Dec 4, 2022
Comment on lines 412 to 413
Alternatively you could use a comprehension like this:
`[a in [1, 5, 601] for a in df.A]`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is slower as it recreates the array, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes:

julia> length(x)
1000000

julia> @time [a in [1, 5, 601] for a in x];
  0.066654 seconds (1.06 M allocations: 80.224 MiB, 10.75% gc time, 32.44% compilation time)

julia> in.(x, Ref([1, 5, 601]));

julia> @time in.(x, Ref([1, 5, 601]));
  0.002442 seconds (8 allocations: 126.547 KiB)

julia> @time in([1, 5, 601]).(x);
  0.002134 seconds (8 allocations: 126.531 KiB)

I will add this comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

bkamins and others added 2 commits December 24, 2022 12:54
@bkamins
Copy link
Member Author

bkamins commented Dec 24, 2022

Thank you!

@bkamins bkamins merged commit be13650 into main Dec 24, 2022
@bkamins bkamins deleted the bk/doc_basics branch December 24, 2022 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants