Saving in Jupyter causes code to fail

I am going through a course at the moment trying to teach myself how to code with Python. I am on a section about Data Analytics that involve Panads.

I am using Jupyter Notebook inside of VSCode.

The issue that I am having is the code works just as it should (according to the tutorial). However, when I save the file, it will no longer run and gives the error

Failed to start the Kernel.
AttributeError: module ‘numbers’ has no attribute ‘Number’.
View Jupyter log for further details.sized text

Closing and opening VSCode does not resolve the issue. But copying and pasting the code into a fresh file does allow the code to run again. I am clueless as to what can be causing this issue and Google hasn’t yielded me any results.

The code is as follows:-

import pandas as pd
import numpy as np
from pandas import Series, DataFrame

ser1 = Series([1,2,3,4,5,6,7])
ser1
ser1.values

ser2 = Series([1,2,3,4,5,6,7], index=['a', 'b', 'c', 'd', 'e', 'f', 'g'])
ser2
ser2['a'], ser2['f']
ser2[['a','b','f']]

dict_1 = {'AU':'Australian Dollar',
     	'US': 'US Dollar',
     	'IN': 'Indian Rupees',
     	'DK': 'Danish Krones',
     	'SW': 'Swiss Francs'}
dict_1

ser1 = Series(dict_1)
ser1

ser1.name = "Currency"
ser1.index.name="Country"
ser1
ser1.index