I want to add an integer to my pandas.Series
Here is my code:
import pandas as pd
input = pd.Series([1,2,3,4,5])
input.append(6)
When i run this, i get the following error:
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
f.append(6)
File "C:Python33libsite-packagespandascoreseries.py", line 2047, in append
verify_integrity=verify_integrity)
File "C:Python33libsite-packagespandasoolsmerge.py", line 878, in concat
verify_integrity=verify_integrity)
File "C:Python33libsite-packagespandasoolsmerge.py", line 954, in __init__
self.new_axes = self._get_new_axes()
File "C:Python33libsite-packagespandasoolsmerge.py", line 1146, in _get_new_axes
concat_axis = self._get_concat_axis()
File "C:Python33libsite-packagespandasoolsmerge.py", line 1163, in _get_concat_axis
indexes = [x.index for x in self.objs]
File "C:Python33libsite-packagespandasoolsmerge.py", line 1163, in <listcomp>
indexes = [x.index for x in self.objs]
AttributeError: 'int' object has no attribute 'index'
How can I fix that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…