Python Forum
NPL function: data cleaning a variables' categories - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: NPL function: data cleaning a variables' categories (/thread-24915.html)



NPL function: data cleaning a variables' categories - Netherlands_Hi - Mar-10-2020

I am looking for the right NPL function to use. Current situation:
My variable "Registration" should have two categories, namely 0 (no) and 1 (yes).
However, the data of this variable is currently distributed among 4 categories; namely:

0 220
1 132
yes 93
si 82

Therefore, I want to use a NPL function in which I can move the data in "yes" and "si" to "1".
In order words, I want to be left with:

0 220
1 307 (as 132+93+82)

Can someone help me? Thanks!

Please delete this thread.


RE: NPL function: data cleaning a variables' categories - Larz60+ - Mar-11-2020

what is NPL?
see: https://python-forum.io/misc.php?action=help&hid=21
Please explain as many readers (including myself) may not know what NPL stands for.