Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: How does Math::GSL accept data?

by Anonymous Monk
on Jun 07, 2022 at 22:09 UTC ( [id://11144491]=note: print w/replies, xml ) Need Help??


in reply to Re: How does Math::GSL accept data?
in thread How does Math::GSL accept data?

I didn't investigate what's wrong with OP's code and how to use Math::GSL for the task, but

I would have expected either PDL::Basic's hist or PDL::NDBin to accommodate user-provided ranges, in line with your requirement, but it seems neither of them do.

I think you are wrong here, see Variable-width bins

pdl> p$data = pdl qw/ 1 3 25 1 5 1 3 1 2 2 3 3 3 25 1 1 5 2 4500 1 1 1 + 1 5 5 8 000 1 1 5 500 1 1 1 5 2 1 1 1000 1000 1000 1000 5000 1 25 60 +00 500 25 25 9000 1 1 5 1000 6000 25 10 5 5 5 5 1000 9540 1000 5 1 5 +500 2500 2 5 5 5/ [1 3 25 1 5 1 3 1 2 2 3 3 3 25 1 1 5 2 4500 1 1 1 1 5 5 8000 1 1 5 500 + 1 1 1 5 2 1 1 1000 1000 1000 1000 5000 1 25 6000 500 25 25 9000 1 1 +5 1000 6000 25 10 5 5 5 5 1000 9540 1000 5 1 5 500 2500 2 5 5 5] pdl> $binner = PDL::NDBin->new(axes=>[[x => grid => 10 ** sequence 6]] +) pdl> $binner->feed(x => $data) pdl> $binner->process pdl> p $binner->output->{histogram} [47 7 3 15 0] pdl>

Replies are listed 'Best First'.
Re^3: How does Math::GSL accept data?
by Anonymous Monk on Jun 07, 2022 at 22:15 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11144491]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-06-13 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.