Python Forum
Index Function not recognized in Python 3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Index Function not recognized in Python 3
#2
There error is correct. There is no variable or function named index, nor is index['A', 'B', 'C', 'D"] valid for any kind of python I know about.
[python]import pandas as pd

my_ser = pd.Series([1, 2, 3, 4], index=['A', 'B', 'C', 'D'])
index is an optional argument when you create a Series. index=['A', 'B', 'C', 'D'] is treating index as a named argument and passing the value ['A', 'B', 'C', 'D'].
Reply


Messages In This Thread
RE: Index Function not recognized in Python 3 - by deanhystad - Jan-08-2023, 04:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Variable for the value element in the index function?? Learner1 8 726 Jan-20-2024, 09:20 PM
Last Post: Learner1
  is import cointegration_analysis a recognized module mitcht33 1 470 Nov-06-2023, 09:29 PM
Last Post: deanhystad
  The term 'pip' is not recognized as the name of a cmdlet, function michaelnicol 1 670 Jul-16-2023, 11:12 PM
Last Post: deanhystad
  Function to return list of all the INDEX values of a defined ndarray? pjfarley3 2 2,008 Jul-10-2020, 04:51 AM
Last Post: pjfarley3
  min() function in iterable index OokaydO 4 3,010 Apr-23-2020, 09:21 AM
Last Post: OokaydO
  TypeError: size; expecting a recognized type filling string dict a11_m11 0 2,568 Feb-10-2020, 08:26 AM
Last Post: a11_m11
  matplotlib isn't recognized after installation Pavel_47 5 2,893 Sep-18-2019, 07:01 PM
Last Post: snippsat
  how do i get y to be recognized in this comprehension? Skaperen 5 3,177 Aug-26-2019, 07:43 PM
Last Post: Skaperen
  why is my dictionary not recognized as such zatlas1 5 3,851 Jan-14-2019, 01:15 AM
Last Post: woooee
  pyserial-master installed bbut not recognized elwolv1 0 2,010 Jan-04-2019, 08:37 PM
Last Post: elwolv1

Forum Jump:

User Panel Messages

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