Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Help please on simple import of Custom Dataset / Self serve data

I am struggling finding a tuturial that works on importing and using a custom dataset.

I am lost here, could someone please give me a hint ?

Even the first simple step with the simpliest dataset is not working.

Here is my simple test dataset in a csv file:

date,symbol,signal
01/01/2018,AAPL,1
02/01/2018,AAPL,0
03/01/2018,AAPL,0
04/01/2018,AAPL,0
05/01/2018,AAPL,1
06/01/2018,AAPL,0
07/01/2018,AAPL,1
08/01/2018,AAPL,0
09/01/2018,AAPL,0

Import looks "successfull"... I selected first column as primary date, and second column as primary asset :

Name Owner Type Status Created At Last Updated
test xxxx historical success 19/08/2020 à 20:01:42 19/08/2020 à 20:01:42

Then I copy your "How to use" code in a notebook :

from quantopian.pipeline import Pipeline
from quantopian.research import run_pipeline
from quantopian.pipeline.data.user_5804a659d11a8a6a1f0000d1 import test

pipe = Pipeline(
columns={
'my_dataset': test.signal.latest
},
screen=test.signal.latest.notnull()
)

df = run_pipeline(pipe, '2018-01-01', '2018-09-01')
df.head()

And obtain the following error :

ImportError Traceback (most recent call last)
in ()
1 from quantopian.pipeline import Pipeline
2 from quantopian.research import run_pipeline
----> 3 from quantopian.pipeline.data.user_5804a659d11a8a6a1f0000d1 import test
4
5 pipe = Pipeline(

ImportError: cannot import name 'test'

Which unfortunatelly doesn't tell me what the problem is.

Would be nice to have a simple csv file, say in a repo and a working notebook as an example...

What is wrong here ?

Thanks in advance for your help.

2 responses

Try reloading the notebook. If you are a loading a new dataset into a notebook you will need to restart the notebook kernel to be able to access the new import.

Check out the documentation for a step by step tutorial for using self-serve data. The tip about reloading the notebook is in the considerations section.

We have all done this and gotten that error. When in doubt reload the notebook.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Well, I made the Notebook after the import.

Anyhow following your reply, I went back to the notebook and it did work perfectly.

Thanks

Pipeline Execution Time: 3.54 Seconds
my_dataset
2018-01-02 00:00:00+00:00 Equity(24 [AAPL]) 1
2018-01-03 00:00:00+00:00 Equity(24 [AAPL]) 1
2018-01-04 00:00:00+00:00 Equity(24 [AAPL]) 1
2018-01-05 00:00:00+00:00 Equity(24 [AAPL]) 1
2018-01-08 00:00:00+00:00 Equity(24 [AAPL]) 1