# Sorting in python dataframes

**URL:** <https://discuss.python.org/t/sorting-in-python-dataframes/24651>\
**Category:** Python Help\
**Created:** [March 9, 2023, 4:02pm UTC](https://discuss.python.org/t/sorting-in-python-dataframes/24651 "2023-03-09T16:02:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lauri122](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/lauri122/32/11229_2.png) [@Lauri122](https://discuss.python.org/u/Lauri122)\
**Post date:** [March 9, 2023, 4:02pm UTC](https://discuss.python.org/t/sorting-in-python-dataframes/24651/1 "2023-03-09T16:02:06Z")

</div>

I have a dataframe that looks as attached-

 ![image](https://us1.discourse-cdn.com/flex002/uploads/python1/original/2X/b/bc66fa0d07808e257a4a4b3764e8f7be87ab6ab5.png)

I am trying to sort it according the value in 4th column of every 2nd row. For example in the first row this value is 5

I want to store all the values below the rows wherever this value is 5 and make a different datafram with those values.  
For example here is what I am expecting the dataframe for value = 5 at position in 4th column of every row that begins with 2.0 -

5.60196 2.98423 2.21817 0.04454  
5.23222 0.87787 0.67289 0.04454 0.00000  
and so on…

I want to make mini dataframes out of this big one for different values starting from 1,2,3,4,5,6,7,8,9,10 at this position.  
Is there a nice way to do this?

I attach my file- [SwissTransfer.com - Envoi sécurisé et gratuit de gros fichiers](https://www.swisstransfer.com/d/6b9d6ebb-64cc-4868-b570-b6d448b87ddd)
