回答編集履歴

1

numpy

2020/02/10 05:40

投稿

kirara0048
kirara0048

スコア1399

test CHANGED
@@ -15,3 +15,27 @@
15
15
  # Timedelta('0 days 09:07:21.800000')
16
16
 
17
17
  ```
18
+
19
+
20
+
21
+ ---
22
+
23
+
24
+
25
+ 追記:NumPyで処理させると計算が速くなります。
26
+
27
+
28
+
29
+ ```Python
30
+
31
+ base_time = np.datetime64(0, 'ns')
32
+
33
+ avg_time = ((dfres['登録時刻'].to_numpy() - base_time) % np.timedelta64(1, 'D')).mean()
34
+
35
+
36
+
37
+ print(pd.Timedelta(avg_time))
38
+
39
+ # Timedelta('0 days 09:07:21.800000')
40
+
41
+ ```