摘要: 创建Series 使用列表创建Series # 1 import pandas as pd book = ['三国演义', '水浒传', '西游记', '红楼梦'] s = pd.Series(book) print(s) # 0 三国演义 # 1 水浒传 # 2 西游记 # 3 红楼梦 # dty 阅读全文
posted @ 2022-04-04 12:10 Soldier&Justice 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 字典(dict)是键值对的无序集合。字典中的每个元素包含用冒号隔开的“键”和“值”两部分,表示一种映射关系,也称之为关联数组。字典中的“键”可以是python中任意不可变数据,如整数、元祖、和字符串等,而且“键”不可以重复,“值”可以重复。 创建字典 使用{}创建 book_author = { ' 阅读全文
posted @ 2022-04-04 11:34 Soldier&Justice 阅读(139) 评论(0) 推荐(0) 编辑
摘要: datetime对象 类方法(class method) datetime.strptime(date_string, format) 返回对应于date_string的datetime对象,其中date_string基于format进行语法分析 >>> from datetime import d 阅读全文
posted @ 2022-04-04 10:18 Soldier&Justice 阅读(147) 评论(0) 推荐(0) 编辑