pandas 系列名称 [英] Pandas series name

查看:126
本文介绍了 pandas 系列名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图将我的系列命名为积分",但它不会显示为积分.

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

我在做什么错了?

推荐答案

点是分配给系列的变量.

Points is your variable assigned the your series.

Points = Points.rename("Points")

在上面的示例中不是"s".

Not "s" in the above example.

print(Points)

0    1
1    2
2    3
Name: Points, dtype: int64

print(Points.name)

'Points'

这篇关于 pandas 系列名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆