Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use math instead of numpy in some places #6765

Merged
merged 4 commits into from
Jul 9, 2022

Conversation

Illviljan
Copy link
Contributor

@Illviljan Illviljan commented Jul 8, 2022

Use math instead of numpy where possible, looks better and seems faster as well.
Idea from #6702 (comment), dask/dask#9232

Example:

%timeit math.prod((1, 2, 3))
161 ns ± 10.5 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)

%timeit int(np.prod((1, 2, 3)))
11.9 µs ± 248 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)

@Illviljan Illviljan changed the title Use math instead of numpy in some places Use math instead of numpy in some places Jul 8, 2022
@Illviljan Illviljan merged commit 2736b28 into pydata:main Jul 9, 2022
@Illviljan Illviljan deleted the use_math_prod branch August 12, 2022 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants