I am importing a csv that looks like this. The possible values are $ and net
Type1,Type2,Type3
$,,
$,net,
net,$,$
I currently have it in a pandas dataframe and am wondering how I can map $ and net to different values.
I want to map $ -> DEPOSIT and net to -> NET DEP
I am passing the column into a function
def directDeposit(var):
for value in var:
var.astype(str)
if value == '$':
var = value.map({'$':'DEPOSIT'})
df['type1'] = directDeposit(df['type1'])`
Because there are three possible types from the csv I wanted to be able to pass the type I was testing into the function so that I could repeat it for all 3. I'm not really sure where to go from here.