PacktPublishing / Hands-On-Data-Science-for-Marketing

Hands-On Data Science for Marketing, published by Packt
MIT License
230 stars 164 forks source link

Chapter 6 Cell 27has error #1

Open SSJUSA opened 3 years ago

SSJUSA commented 3 years ago

Hello

In Chapter 6 Product Recommendations, Cell # 27 is giving error shown below:

items_bought_by_A = set(customer_item_matrix.loc[12350.0].iloc[ customer_item_matrix.loc[12350.0].nonzero() ].index) items_bought_by_A

AttributeError Traceback (most recent call last)

in 1 items_bought_by_A = set(customer_item_matrix.loc[12350.0].iloc[ ----> 2 customer_item_matrix.loc[12350.0].nonzero() 3 ].index) 4 items_bought_by_A C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\generic.py in __getattr__(self, name) 5128 if self._info_axis._can_hold_identifiers_and_holds_name(name): 5129 return self[name] -> 5130 return object.__getattribute__(self, name) 5131 5132 def __setattr__(self, name: str, value) -> None: AttributeError: 'Series' object has no attribute 'nonzero' Please fix this error and upload fixed Jupyter notebook to this book's github webpage. Thank you, SSJ
gaurav-packt commented 3 years ago

Hello,

Thanks for raising this.

We've executed the script in the Jupyter Notebook and found the required output.

SSJUSA commented 3 years ago

Thank you. Please inform Author to fix the error to the program file and upload corrected file to this github web page.

Thanks SSJ

On Wed, Sep 2, 2020 at 11:25 AM gaurav-packt notifications@github.com wrote:

Hello,

Thanks for raising this.

We've executed the script in the Jupyter Notebook and found the required output.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PacktPublishing/Hands-On-Data-Science-for-Marketing/issues/1#issuecomment-685810269, or unsubscribe https://github.com/notifications/unsubscribe-auth/APPYKBKOJE2QOXB4HK6VOB3SDZPVBANCNFSM4QJ3F6WQ .

gaurav-packt commented 3 years ago

The file seems fine during execution and the output is generated. Can you please re-check the file?

Thanks.