回答編集履歴

1

追記

2020/04/29 09:55

投稿

meg_
meg_

スコア10760

test CHANGED
@@ -15,3 +15,59 @@
15
15
  df.query('age < 25 & point > 65')
16
16
 
17
17
  ```
18
+
19
+ ---
20
+
21
+ 【追記】
22
+
23
+ 簡単なdfで試してみました。
24
+
25
+ ```Python
26
+
27
+ print(df)
28
+
29
+ # day_start_from_0120
30
+
31
+ #0 52
32
+
33
+ #1 52
34
+
35
+ #2 60
36
+
37
+ #3 65
38
+
39
+ #4 5
40
+
41
+ #5 3000
42
+
43
+
44
+
45
+ df_test = {}
46
+
47
+
48
+
49
+ lists = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
50
+
51
+ days = [52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]
52
+
53
+ for(list, day) in zip (lists, days):
54
+
55
+ df_test[list] = df.query('@day <= day_start_from_0120 < @day+16')
56
+
57
+ print(list, day)
58
+
59
+
60
+
61
+ print(df_test[1])
62
+
63
+ # day_start_from_0120
64
+
65
+ #0 52
66
+
67
+ #1 52
68
+
69
+ #2 60
70
+
71
+ #3 65
72
+
73
+ ```