In Python i have created a function that has 4 arguments (2 mandatory 2 optional)
def combineDateTime(dateInput, timeInput, dateInputFormat='%Y-%m-%d', timeInputFormat='%H:%M:%S'):
.....
I want to create a new column on my dataframe by calling the function and passing it the values from 2 of the existing dataframe columns, however i cannot get my head around the syntax required in order to pass the required columns.
The function tests the type of the values passed (eg str, int etc) and does different things depending on it but i think the issue is that its being passed a series and therefore the logic isn't working.
Can anyone advise how i should be calling it. I'm trying to use the .apply functionality.
df_scd2_pd['NewColumn'] = df_scd2_pd[[col_EffFromDT,col_EffFromTM]].apply(combineDateTime, axis=1)
Many Thanks