Python 3.x 员工每日出勤时间的标准偏差

Python 3.x 员工每日出勤时间的标准偏差,python-3.x,standards,deviation,Python 3.x,Standards,Deviation,我想计算员工每日时间的标准偏差 以下是我正在导入的数据帧或csv: EmpCode,Date,InTime,OutTime,expetcedIn,expetcedOut 9889,01-Feb-17,9:34 AM,5:41:00 PM,9:30:00 AM,5:30:00 PM 如何使用Python?我希望您想要的是为每个客户获得每日工作时间的s.d import pandas as pd # Read csv and parses col[1,2] as InTimeWithDate

我想计算员工每日时间的标准偏差

以下是我正在导入的数据帧或csv:

EmpCode,Date,InTime,OutTime,expetcedIn,expetcedOut

9889,01-Feb-17,9:34 AM,5:41:00 PM,9:30:00 AM,5:30:00 PM

如何使用Python?

我希望您想要的是为每个客户获得每日工作时间的s.d

import pandas as pd

# Read csv and parses col[1,2] as InTimeWithDate and col[1,3] as OutTimeWithDate
df=pd.read_csv("emp.csv", parse_dates={"InTimeWithDate":[1,2],"OutTimeWithDate":[1,3]})

# Gets difference between In and out time in minutes : to get in seconds changed timedelta64[m] to timedelta64[s]
df["minutes_worked"]= (df["OutTimeWithDate"]-df["InTimeWithDate"]).astype('timedelta64[m]')

# Groups by employee and gets standard diff of minutes worked
new_df = df.groupby("EmpCode").agg({"minutes_worked":["std"]})
print(new_df)

你能把你的问题说清楚吗?你想计算每天的标准偏差吗?嗨,谢谢你的帮助,但我想计算预计时间(上午9:30)的标准偏差。这里的平均值固定在上午9:30,然后要绘制员工标准偏差的K平均值