Hi I'm still learning pandas and numpy in python
I learn from e-learning that you could combine 2 series with append but when I tried it It give me error
students_classes = pd.Series({'Alice': 'Physics',
'Jack': 'Chemistry',
'Molly': 'English',
'Sam': 'History'})
students_classes
kelly_classes = pd.Series(['Philosophy', 'Arts', 'Math'], index=['Kelly', 'Kelly', 'Kelly'])
kelly_classes
all_students_classes = students_classes.append(kelly_classes)
all_students_classes
and It give me error like this
AttributeError Traceback (most recent call last)
Cell In\[35\], line 3
1 # Finally, we can append all of the data in this new Series to the first using the .append()
2 # function.
\----\> 3 all_students_classes.str = students_classes.append(kelly_classes)
5 # This creates a series which has our original people in it as well as all of Kelly's courses
6 all_students_classes
File \~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\pandas\\core\\generic.py:5989, in NDFrame.__getattr__(self, name)
5982 if (
5983 name not in self.\_internal_names_set
5984 and name not in self.\_metadata
5985 and name not in self.\_accessors
5986 and self.\_info_axis.\_can_hold_identifiers_and_holds_name(name)
5987 ):
5988 return self\[name\]
\-\> 5989 return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'append'
pandas
documentation? Does theSeries
have aappend
method? Also what version is yourpandas
? – Lennielenno