Python Forum
Python Custom Module not working in Jupyter Notebook with Pandas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Custom Module not working in Jupyter Notebook with Pandas
#1
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...sp=sharing

Thanks in advance.

Fid
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Jupyter notebooks, jupyter kernels, virtual environment created in Anaconda... bytecrunch 8 1,922 Nov-05-2023, 06:38 PM
Last Post: snippsat
  Jupyter Notebook TypeError Holidays entity loader class bmanning20 0 2,492 Jul-20-2023, 06:52 PM
Last Post: bmanning20
  Why does graph look different in Codecademy and Jupyter Notebook abc123456 1 1,400 Mar-29-2023, 09:22 AM
Last Post: newbieAuggie2019
  Setting up and integrating Jupyter Notebook development environment with VSC Drone4four 3 1,688 Sep-12-2022, 09:18 AM
Last Post: Drone4four
Thumbs Up can't access data from URL in pandas/jupyter notebook aaanoushka 1 1,781 Feb-13-2022, 01:19 PM
Last Post: jefsummers
Exclamation Jupyter Notebook - Help Needed! eyadfr 1 1,766 Jan-26-2022, 06:42 PM
Last Post: jefsummers
  Help needed with Jupyter Notebook eyadfr 4 2,034 Jan-04-2022, 08:20 PM
Last Post: snippsat
  Pandas replace function not working on datafram with floats bcrypto 1 2,733 Apr-12-2021, 08:59 PM
Last Post: bcrypto
  HELP! Importing json file into csv into jupyter notebook vilsef 2 2,466 Jan-22-2021, 11:06 AM
Last Post: snippsat
  How can draw a real-time marker on map using folium/leaflet Jupyter notebook C3PO 0 2,341 Dec-22-2020, 07:04 PM
Last Post: C3PO

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020