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.
반응형
'Python, PySpark' 카테고리의 다른 글
SAS retain equivalent in Python (0) | 2021.08.22 |
---|---|
python pandas.assign() 여러 변수 만들기 : 이전 변수 의존 (0) | 2021.06.26 |
Python Pandas column name 일괄 변경 (0) | 2021.06.07 |
Python Pandas SQL like function (0) | 2021.06.02 |
Python 주요 라이브러리 (0) | 2021.05.13 |