首页 > 编程语言 >Python DataFrame Learning

Python DataFrame Learning

时间:2022-09-29 09:12:49浏览次数:64  
标签:Python DataFrame column Learning df Pandas first

Getting the first column of a Pandas DataFrame as a Series results in a Pandas Series object representing the first column.

df = pd.DataFrame({"Letters": ["a", "b", "c"], "Numbers": [1, 2, 3]})
first_column = df.iloc[:, 0]
get first column of df

print(first_column)

Reference Link

(Python help)[https://www.adamsmith.haus/python/answers/how-to-get-the-first-column-of-a-pandas-dataframe-as-a-series-in-python]

标签:Python,DataFrame,column,Learning,df,Pandas,first
From: https://www.cnblogs.com/Miguel-Du/p/16740249.html

相关文章

  • python接口自动化测试(二)
    pytest前置后置操作参考链接:https://blog.csdn.net/weixin_44045851/article/details/122744235学习目标:1.前置后置操作的作用2.使用fixture设置前置后置操作3.前置......
  • python4
    实例1、输出每日一贴importdatetimemot=["今天星期一:\n坚持下去不是因为我很坚强,而是因为我别无选择。","今天星期二:\n含泪播种的人一定能笑着收获。","今天星期三:\n......
  • Python第四章
    实例1:输出每日一贴实验过程:importdatetime#导入日期时间类mot=["今天星期一:\n坚持下去不是因为我很坚强,而是因为我别无选择。","今天星期二,\n含泪播种的人一......
  • Python实验报告
                                                     第4章  ......
  • Python第四章
    importdatetime#定义一个列表mot=["今天星期一:\n坚持下去不是因为我坚强,而是因为我别无选择。",    "今天星期二:\n含泪播种的人一定能笑着收获。",   ......
  • python 如何快速升级pip
    1.首先通过快捷键“win+R”打开运行窗口。输入cmd。点击“确定”,以管理员身份打开命令行界面2.在命令行界面输入“piplist”按下Enter3.直接拉到最下面有两行英文大......
  • python实验报告第四章——序列的应用
                             python第四章——序列的应用一、实验目的和要求1、了解python中的序列结构2、学会使用列......
  • Python语言基础实验(第四周)
    Python语言基础实验(第四周)一、实验目的1.了解并掌握python中序列及序列的常用操作。2.根据实际需要运用合适的序列类型来完成实验。二、实验环境软件版本:Python3.......
  • Python4
    实战01print("“王者荣耀”的游戏角色:")print("====坦克:====")tank=["苏烈","刘邦","钟馗","张飞","牛魔","程咬金","白起","刘禅","庄周","项羽","廉颇","巨灵神"......
  • python学习随笔
    本周python学习随笔一、Python中的数据类型 Number【数字:整型int,浮点型[小数]float,复数类型complex】String【字符串】strBoolean【布尔类型】True真(1),Flase假(0)N......