回答編集履歴
2
追記
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
変数名の前に`@`マークを付けることで、呼び出し元で定義された変数にアクセスできます。
|
1
|
+
クエリ文字列中の変数名の前に`@`マークを付けることで、呼び出し元で定義された変数にアクセスできます。
|
2
2
|
|
3
3
|
|
4
4
|
|
1
ついき
test
CHANGED
@@ -9,3 +9,15 @@
|
|
9
9
|
> The query string to evaluate. You can refer to variables in the environment by prefixing them with an ‘@’ character like @a + b.
|
10
10
|
|
11
11
|
> [pandas.DataFrame.query — pandas 0.23.4 documentation](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.query.html)
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
質問文のコードはこれで行けるでしょうか。
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
```python
|
20
|
+
|
21
|
+
df1 = df_sorted[u].query('C_PRICE < A_PRICE & DATE == @i')
|
22
|
+
|
23
|
+
```
|