I've come upon something I'm a bit unsure about:
Basically, I have a dataset where one column is a series of three digit codes. I only really need the first digit of those codes though for my analysis. For this reason, I want to create a new column containing only the first digit of that column, so I can do some dummy variables based on that. For example, if A is the original column, I want to create column B, as below:
Anyone got an idea how to do this? I can't find anything online. Alternatively, if its possible to base dummy variables based on only the first digit of A, without creating B, that would also work.