Skip to content

Commit 2dd3f61

Browse files
author
Dario Varotto
committed
Using the new filters
1 parent dc34515 commit 2dd3f61

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ravenpackapi/examples/copy_dataset.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
print(us30.filters)
1212

13+
# creating a new dataset with modified filters and fields
14+
# the filters are an aggregation of the us30 with some additional rule
1315
new_filters = {"$and": [
1416
us30.filters,
1517
{"relevance": {
@@ -65,14 +67,17 @@
6567
}
6668
}
6769
]
70+
6871
custom_dataset = Dataset(api=api,
6972
name="Us30 indicators",
70-
filters=us30.filters,
73+
filters=new_filters,
7174
fields=new_fields,
7275
frequency='daily'
7376
)
7477
custom_dataset.save()
7578
print(custom_dataset)
79+
80+
# query the datafile and save it to file
7681
job = custom_dataset.request_datafile(
7782
start_date='2017-01-01 19:30',
7883
end_date='2017-01-02 19:30',

0 commit comments

Comments
 (0)