I've frequently used the account, customer level data. Sometimes there's an requests to make the application table into customer level data. In this case, we can use the python group by but I should the account level data with priority. For example, customers may apply multiple Credit Card and I should tag the account like '1st', '2nd', '3rd'.

 In SAS, Impala's world, it's not so difficult make this but there's no function in python.

 

 I've already searched the similar function in Python but couldn't find the solution. Thus I've made the simple code to generate the order like below.

If you find the proper solution except the above code, please leave a message.

반응형

+ Recent posts