I'm trying to get the function i made to apply to columns I specified by separating in the iloc function
# Import useful packages for data science
import numpy as np
import pandas as pd
import os
import sys
import time
import datetime
import time
#setting the triathlone data set as TD
TD=pd.read_csv("/Applications/TriathloneData.csv")
TD
def hms_to_seconds(t):
if(type(t) != str):
return np.NaN
else:
h, m, s = [int(i) for i in t.split(':')]
return 3600*h + 60*m + s
# first I'll separate each column I need to apply the function to
TDdf = pd.DataFrame(TD)
TDdfTime = TDdf.iloc[:,6:12]
TDdfTime