dataframe object is not callable

Есть такой код. Идея в том, чтобы ускорить обработку большого датафрейма мультипроцессингом.

Вызываю таким образом

Полный текст ошибки такой :

TypeError: ‘DataFrame’ object is not callable

Начинает ругаться на :

df = pd.concat(pool.imap(func, df_split))

Где у меня ошибка? Импорт необходимых модулей сделан-pandas,multiprocessing и тд

When I run it, it keeps telling me the dataframe object is not callable.

1 Answer 1

The problem is the property decorator on crawl_data . This answer explains how the property decorator actually works, but basically, dataframe.crawl_data is the dataframe returned by the function, not the function. So dataframe.crawl_data() in the first line of clean_data is trying to call the dataframe, not the function.

Here’s an example:

This question really could have done with the stacktrace. It would have lead us right to line with the problematic call.

Not the answer you’re looking for? Browse other questions tagged python class pandas dataframe or ask your own question.


Hot Network Questions

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 4.0 with attribution required. rev 2019.11.15.35459

I am trying to narrow down securities from my pipeline, but I am running into errors.

The error is on the line context.longs_5 = context.longs_10([‘RSI’], ascending=False).iloc[:5]

Does anyone have any ideas?

Maybe forgot the ‘.sort’?

should maybe be..

Sorry, something went wrong. Try again or contact us by sending feedback.

You’ve successfully submitted a support ticket.

Our support team will be in touch soon.

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.

Оцените статью