Multi-level sorting

2015512701120155127011 MemberPosts:1Learner I
edited November 2018 inHelp

I have a table something like this:

Column A Column B Column C
Jane Doe A1 1
Jane Doe B2 2
John Doe A1 1
John Doe A2 2
John Doe B1 1

I need to sort this table firstly Column A then Column B then Column C. I can do this in Excel like this:a.png

I tried to chain multiple sort operators but it didn't work.

a.png 0B

Answers

  • jreinosojreinoso RapidMiner Certified Analyst, MemberPosts:5Contributor II
    嗨。我试着手提钻类(广告vanced) operator, but it seems to NOT work if one of the attributes is date datatype.
  • hbajpaihbajpai MemberPosts:102Unicorn
    Hey@jreinoso,

    If you are familiar with Python scripting in rapidminer, you can do achieve the operation in a single line of code.

    Let's say you have this dataset,


    and use use pandas sort_values function.
    data.sort_values(['Date','ColA', 'ColB'], ascending = [True, False, True], inplace = True)
    You will get the following result.


    Check out the demo XML.
                                                          


    Best,
    Harshit
    lionelderkrikor
  • dyoolyoosdyoolyoos MemberPosts:6Contributor II
    edited September 2020
    对不起错了最初的评论。正在寻找t如何o manually change the order of nominal labels, say, in a heat map. (may be out of topic)
Sign InorRegisterto comment.