mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-06 01:12:27 +00:00
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:
@@ -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")
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user