Jan-08-2023, 03:07 AM
Hi Everyone,
I'm learning Python from an Online course and all was going well until I got to the subject of 'Series'.
There are some exercises where Series is Used with Index & it throws an error as described below.
The course uses Python 2 and I've tried to find the equivalent of Index from Python 2 to Python 3 with no luck.
Here's my script Using Jupyter Notebooks from Anaconda and Windows 10 o/s.
Any suggestions appreciated.
I'm learning Python from an Online course and all was going well until I got to the subject of 'Series'.
There are some exercises where Series is Used with Index & it throws an error as described below.
The course uses Python 2 and I've tried to find the equivalent of Index from Python 2 to Python 3 with no luck.
Here's my script Using Jupyter Notebooks from Anaconda and Windows 10 o/s.
Any suggestions appreciated.
import numpy as np from pandas import Series, DataFrame import pandas as pd my_ser = Series([1,2,3,4],index['A','B','C','D']) --------------------------------------------------------------------------- NameError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_21480/685396208.py in <module> ----> 1 my_ser = Series([1,2,3,4],index['A','B','C','D']) NameError: name 'index' is not defined