pandas的dataframe
时间: 2023-09-13 12:07:10 浏览: 104
Pandas的DataFrame是一种二维数据结构,可以看作是一张表格,其中的数据以行和列的形式进行组织。DataFrame可以由多种类型的数据创建,包括列表、字典、数组等。与Numpy的ndarray相比,DataFrame提供了更多的数据操作和分析功能。
例如,可以使用列表或字典创建DataFrame,如下所示:
df1 = pd.DataFrame(data=[[1, 2, 3], [11, 12, 13]], index=['r_1', 'r_2'], columns=['A', 'B', 'C'])
df2 = pd.DataFrame(data=[[1], [11]], index=['r_1', 'r_2'], columns=['A'])
df3 = pd.DataFrame(data=np.arange(12).reshape(3, 4), index=list("abc"), columns=list("ABCD"))<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Pandas之DataFrame详解](https://blog.csdn.net/ytp552200ytp/article/details/115550564)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Pandas基础——DataFrame](https://blog.csdn.net/qq_48003414/article/details/116976339)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文