Update eval help command (#2924)

* Add some more clear definition

* remove about

Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com>
This commit is contained in:
James Maslek
2022-10-20 10:06:43 -04:00
committed by GitHub
parent 90b5e10cf8
commit bd8ac50549
2 changed files with 11 additions and 4 deletions

View File

@@ -1716,7 +1716,12 @@ class EconomyController(BaseController):
add_help=False,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
prog="eval",
description="""Create custom data column from loaded datasets.""",
description="""Create custom data column from loaded datasets. Can be mathematical expressions supported
by pandas.eval() function.
Example. If I have loaded `fred dgs2 dgs5` and I want to create a new column that is the difference
between these two, I can create a new column by doing `eval spread = dgs2 - dgs5`
""",
)
parser.add_argument(
"-q",
@@ -1724,6 +1729,7 @@ class EconomyController(BaseController):
type=str,
nargs="+",
dest="query",
help="Query to evaluate on loaded datasets",
)
if other_args and "-" not in other_args[0][0]:
other_args.insert(0, "-q")

View File

@@ -1,13 +1,14 @@
```
usage: eval [-q QUERY [QUERY ...]] [-h] [--export EXPORT]
```
Create custom data column from loaded datasets.
Create custom data column from loaded datasets. Can be mathematical expressions supported by pandas.eval() function.
Example. If I have loaded `fred dgs2 dgs5` and I want to create a new column that is the difference between these two,
I can create a new column by doing `eval spread = dgs2 - dgs5`.
Note that for division, the / operator will cause issues, so one should do `*N**-1` where N is the number you are dividing by
Note that for division, the / operator will cause issues, so one should do `*N**-1` where N is the number you are dividing by
```
options:
-q QUERY [QUERY ...], --query QUERY [QUERY ...]
-h, --help show this help message (default: False)
--export EXPORT Export raw data into csv, json, xlsx (default: )
```
For more information and examples, use 'about eval' to access the related guide.