Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7573297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:08:50+00:00 2026-05-30T16:08:50+00:00

Is there an elegant PDL function which receives a list of values and returns

  • 0

Is there an elegant PDL function which receives a list of values and returns a list of 80% of the original values which are the lowest?

For example:
If I have a list like so: (9, 4, 1, 2, 7, 8, 3, 5, 6, 10)

I would like to get (1, 2, 3, 4, 5, 6, 7, 8) after calling this function on the original list (The order of the values does not matter – it does not need to sort the values).

I found PDL::Ufunc::oddpct which can return the 80’th percentile but I would like to get a list of the values up to that percentile. I can do it myself but if there’s something out of the box – why not use it?

Thanks!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:08:52+00:00Added an answer on May 30, 2026 at 4:08 pm

    I suggest you use pct to get the 80th percentile figure, combined with the where primitive to select everything beneath that value. Using your own data it looks like this

    use strict;
    use warnings;
    
    use PDL;
    
    my $list = pdl(9, 4, 1, 2, 7, 8, 3, 5, 6, 10);
    print qsort $list->where($list <= $list->pct(80/100));
    

    OUTPUT

    [1 2 3 4 5 6 7 8]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an elegant way to have performant, natural sorting in a MySQL database?
Is there an elegant way to create and initialize a const std::vector<const T> like
Is there an elegant notation for Currying the arguments of a function out of
Is there an elegant way of doing this? Perhaps with Linq? For something like
Hi Is there any elegant way of combining 'like' and 'or' when i'm using
Is there any elegant way of splitting a list/dict into two lists/dicts in python,
I have two lists: A = [1,2,3] B = [4,5,6] Is there an elegant
Is there more elegant way(LINQ or other) to initialize array like this? int[] result
Is there an elegant way of getting values from a massive multi-dimensional array using
Given a list of lists as such, is there an elegant way to convert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.