title: Selecting the top 50 % percentage names from the columns of a pandas dataframe
body: <p>I have a pandas dataframe that looks like this. The rows and the columns have the same name.</p>
  
  <pre><code>name a  b  c  d  e  f  g 
   a   10 5  4  8  5  6  4
   b   5  10 6  5  4  3  3
   c   -  4  9  3  6  5  7
   d   6  9  8  6  6  8  2
   e   8  5  4  4  14 9  6
   f   3  3  -  4  5  14 7
   g   4  5  8  9  6  7  10
  </code></pre>
  
  <p>I can get the 5 number of largest values by passing df['column_name'].nlargest(n=5) but if I have to return 50 % of the largest in descending order, is there anything that is inbuilt in pandas of it I have to write a function for it, how can I get them? I am quite new to python. Please help me out. </p>
  
  <p>UPDATE : So let's take column a into consideration and it has values like 10, 5,-,6,8,3 and 4. I have to sum all of them up and get the top 50% of them. so the total in this case is 36. 50% of these values would be 18. So from column a, I want to select 10 and 8 only. Similarly I want to go through all the other columns and select 50%.</p>