Python Forum
Python Custom Module not working in Jupyter Notebook with Pandas - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Python Custom Module not working in Jupyter Notebook with Pandas (/thread-28089.html)



Python Custom Module not working in Jupyter Notebook with Pandas - fid - Jul-04-2020

Hi Guys,


I have made a custom code in Python that i was to apply to a spreadsheet with Jupyter Notebook.

I get the following error code and do not understand how to fix it.


E:\OneDrive\Coding\Python\004 - Tax 3\Cont Tax\a_calc_marginals.py in calculate(self)
42 percentage = percentage_list
43
---> 44 bracket.append(int(self.value))
45
46 bracket = [num for num in bracket if num <= self.value]

E:\Anaconda3\lib\site-packages\pandas\core\series.py in wrapper(self)
110 if len(self) == 1:
111 return converter(self.iloc[0])
--> 112 raise TypeError(f"cannot convert the series to {converter}")
113
114 wrapper.__name__ = f"__{converter.__name__}__"

TypeError: cannot convert the series to <class 'int'


Could someoe please take a look?

I have shared on Google Drive in the following location.

https://drive.google.com/file/d/1vAnNtLa-nOwAeUm87mS0Hj_HYf99J5xK/view?usp=sharing

Thanks in advance.

Fid