Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
filter < doesn't work while filter > does

hello, kind of new to this so please apologize if this is very simple but I bang my head on this....

this returns a dataframe quite well :

df = get_fundamentals(query(fundamentals.valuation.market_cap,fundamentals.valuation_ratios.ev_to_ebitda,fundamentals.income_statement.ebit)  
                             .filter(fundamentals.valuation.market_cap > 3e11)  
                             .order_by(fundamentals.valuation.market_cap.desc())  
                             , today  
                             )  
df  

but if I change > to <

.filter(fundamentals.valuation.market_cap < 3e11) 

I got an error

---------------------------------------------------------------------------  
HTTPError                                 Traceback (most recent call last)  
<ipython-input-50-ae30368ea84e> in <module>()  
      2                              .filter(fundamentals.valuation.market_cap < 3e11)  
      3                              .order_by(fundamentals.valuation.market_cap.desc())  
----> 4                              , today  
      5                              )  
      6 df

/home/qexec/src/qexec_repo/qexec/research/api.py in get_fundamentals(query, base_date, range_specifier, filter_ordered_nulls)
    263             base_date,  
    264             range_specifier,  
--> 265             filter_ordered_nulls,  
    266         )  
    267 

/home/qexec/src/qexec_repo/qexec/research/api.py in get_fundamentals_with_namespace(ns, available_date_tbl, query, base_date, range_specifier, filter_ordered_nulls)
    285         filter_ordered_nulls,  
    286     )  
--> 287     return client.get_fundamentals(query_dict)  
    288  
    289 

/home/qexec/src/qexec_repo/qexec/research/web/client.py in get_fundamentals(self, query_dict)
    288             query_dict['params'],  
    289             query_dict['columns'],  
--> 290             query_dict['return_panel'],  
    291         )  
    292 

/home/qexec/src/qexec_repo/qexec/research/web/client.py in _make_get_fundamentals_request(self, query, params, columns, return_panel)
    274         )  
    275  
--> 276         resp.raise_for_status()  
    277  
    278         return resp

/usr/local/lib/python2.7/dist-packages/requests/models.pyc in raise_for_status(self)
    849  
    850         if http_error_msg:  
--> 851             raise HTTPError(http_error_msg, response=self)  
    852  
    853     def close(self):

HTTPError: 500 Server Error: INTERNAL SERVER ERROR  
1 response

So I was able to recreate your issue and I believe that the issue is the amount of data you are asking for is too much. If you are filtering for stocks with a market cap of less than $300 billion, that description fits a lot of companies. In fact the implementation of that filter by using the less than sign '<' only excludes about 6 companies. I'll double check that with one of our engineers, but I though I'd answer in the mean time so you can keep coding. Meaningful exception messages in Research is an aspect of the UX we are working to improve.

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.