Python 基于每行的其他相对值计算新值 相对于员工完成前一项任务的时间,获得员工的任务体验

Python 基于每行的其他相对值计算新值 相对于员工完成前一项任务的时间,获得员工的任务体验,python,python-2.7,function,datetime,lambda,Python,Python 2.7,Function,Datetime,Lambda,df=pd.read\u csv(“C:Tasks\u revied\u For\u Analysis.csv”) 这就是我想要得到的: Out[15]: Vaughn Informatica 11 Vaughn Python 9 kodams Spotfire 8 kodams java 5 sreddy python 2 我需要获得用户对每种特定任务类型的经验。这就是我在解决这个问题时所能想到的: d

df=pd.read\u csv(“C:Tasks\u revied\u For\u Analysis.csv”)

这就是我想要得到的:
Out[15]:
Vaughn   Informatica    11
Vaughn   Python         9
kodams   Spotfire       8
kodams   java           5
sreddy   python         2
我需要获得用户对每种特定任务类型的经验。这就是我在解决这个问题时所能想到的:
def RelativeTaskTypeExp (UsernameIn, TechIn, DateIn): 
usertasks = {all} where user = UsernameIn
usertechtasks = {usertask} where tech = TechIn 
usertechpasttasks = {usertechtasks} where middledate < DateIn
    return usertechpasttasks.count()

all Final.apply(lambda row: RelativeTaskTypeExp(row['AssignedTo'], row['TaskType'], row['EmployeeStartDate'], row['TaskEndDate']))
def RelativeTaskTypeExp(UsernameIn、TechIn、DateIn):
usertasks={all},其中user=UsernameIn
usertechtasks={usertask}其中tech=TechIn
usertechpasttasks={usertechtasks},其中middledate

非常感谢您的帮助,非常感谢

你能提供一份工作吗?另请参见。@jpp谢谢您的建议,下面是新问题:
def RelativeTaskTypeExp (UsernameIn, TechIn, DateIn): 
usertasks = {all} where user = UsernameIn
usertechtasks = {usertask} where tech = TechIn 
usertechpasttasks = {usertechtasks} where middledate < DateIn
    return usertechpasttasks.count()

all Final.apply(lambda row: RelativeTaskTypeExp(row['AssignedTo'], row['TaskType'], row['EmployeeStartDate'], row['TaskEndDate']))