Reputation: 75
I am trying to name my series "Points" but it is not showing up as Points.
Points = pd.Series([1,2,3])
print(Points.name)
output: None
I even tried renaming it but it still shows "None"
Points.rename("Points")
print(Points.name)
output: None
What am i doing wrong?
Upvotes: 4
Views: 2590
Reputation: 153460
Points is your variable assigned the your series.
Points = Points.rename("Points")
Not "s" in the above example.
print(Points)
0 1
1 2
2 3
Name: Points, dtype: int64
and
print(Points.name)
'Points'
Upvotes: 3