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

'count(func,itr)' is missing #3180

Closed
GlenHertz opened this issue May 22, 2013 · 6 comments
Closed

'count(func,itr)' is missing #3180

GlenHertz opened this issue May 22, 2013 · 6 comments
Labels
domain:docs This change adds or pertains to documentation

Comments

@GlenHertz
Copy link
Contributor

Hi,

In Julia 0.1 we could use 'countp(func, itr)' but in 0.2-pre it gives a warning that it is deprecated and we should use 'count' instead. However, 'count' dosen't exist in 0.2-pre. Is there another function we should use. If so, deprecated.jl should be updated with accurate info.

Thanks,

Glen

@JeffBezanson
Copy link
Sponsor Member

I like count(func,itr) just fine. @StefanKarpinski @ViralBShah what do you think?

@quinnj
Copy link
Member

quinnj commented May 23, 2013

I've actually wondered where this function went as well. It's still in the
docs anyhow. I find it handy, particularly doing some stats related stuff
with DataFrames.

count(itr) → Integerhttp:https://docs.julialang.org/en/latest/stdlib/base.html#Base.count

Count the number of boolean elements in itr which are true.
countp(p, itr) →
Integerhttp:https://docs.julialang.org/en/latest/stdlib/base.html#Base.countp

Count the number of elements in itr for which predicate p is true.

On Wed, May 22, 2013 at 7:00 PM, Jeff Bezanson [email protected]:

I like count(func,itr) just fine. @StefanKarpinskihttps://github.com/StefanKarpinski
@ViralBShah https://github.com/ViralBShah what do you think?


Reply to this email directly or view it on GitHubhttps://github.com//issues/3180#issuecomment-18315888
.

@StefanKarpinski
Copy link
Sponsor Member

Why isn't this just sum?

On Wednesday, May 22, 2013, Jacob Quinn wrote:

I've actually wondered where this function went as well. It's still in the
docs anyhow. I find it handy, particularly doing some stats related stuff
with DataFrames.

count(itr) → Integer<
http:https://docs.julialang.org/en/latest/stdlib/base.html#Base.count>

Count the number of boolean elements in itr which are true.
countp(p, itr) →
Integerhttp:https://docs.julialang.org/en/latest/stdlib/base.html#Base.countp

Count the number of elements in itr for which predicate p is true.

On Wed, May 22, 2013 at 7:00 PM, Jeff Bezanson <[email protected]<javascript:_e({}, 'cvml', '[email protected]');>>wrote:

I like count(func,itr) just fine. @StefanKarpinski<
https://github.com/StefanKarpinski>
@ViralBShah https://github.com/ViralBShah what do you think?


Reply to this email directly or view it on GitHub<
https://github.com/JuliaLang/julia/issues/3180#issuecomment-18315888>
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3180#issuecomment-18316257
.

@JeffBezanson
Copy link
Sponsor Member

Oh yes, I thought we might have renamed it to something, and that's it.

@JeffBezanson
Copy link
Sponsor Member

Although in the current system count runs faster due to being specialized for summing Ints.

@StefanKarpinski
Copy link
Sponsor Member

I don't understand why you reintroduced count – it does the same thing as sum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation
Projects
None yet
Development

No branches or pull requests

4 participants