pandas把dataframe转成Series,改变列中值的类型方法
作者:Paul_Huang_2011 时间:2023-07-04 11:41:58
使用 pd.Series把dataframe转成Series
ts = pd.Series(df['Value'].values, index=df['Date'])
使用astype改变列中的值的类型,注意前面要有np
df['列名'] = df['列名'].astype(np.int64)
来源:https://blog.csdn.net/hbr2014/article/details/79341741
标签:pandas,dataframe,Series
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python算法学习之基数排序实例
2023-01-07 05:24:52
浅谈JavaScript函数节流
2024-05-03 15:59:31
![](https://img.aspxhome.com/file/2023/7/129077_0s.png)
MySQL数据库同时查询更新同一张表的方法
2024-01-22 23:10:38
![](https://img.aspxhome.com/file/2023/8/81028_0s.png)
封装 Python 时间处理库创建自己的TimeUtil类示例
2023-01-15 00:45:56
PHP的Socket网络编程入门指引
2023-11-18 15:46:12
![](https://img.aspxhome.com/file/2023/3/104183_0s.jpg)
jQuery绑定事件监听bind和移除事件监听unbind用法实例详解
2024-06-20 10:41:03
使用python opencv对畸变图像进行矫正的实现
2021-08-18 01:09:44
![](https://img.aspxhome.com/file/2023/7/124217_0s.jpg)
视觉对交互的帮助——提升可用性
2008-10-16 13:16:00
![](https://img.aspxhome.com/file/UploadPic/200810/16/20081016132344595s.jpg)
Date对象格式化方法
2009-11-16 13:17:00
oracle数据库中如何处理clob字段方法介绍
2024-01-17 05:55:41
一文搞懂Pandas数据透视的4个函数的使用
2022-03-26 02:01:53
![](https://img.aspxhome.com/file/2023/3/68873_0s.png)
PyTorch实现AlexNet示例
2021-08-31 20:15:44
![](https://img.aspxhome.com/file/2023/0/133530_0s.jpg)
python实现会员信息管理系统(List)
2021-12-21 04:50:45
![](https://img.aspxhome.com/file/2023/5/88965_0s.jpg)
JS严格模式知识点总结
2024-05-13 10:06:42
Django 权限认证(根据不同的用户,设置不同的显示和访问权限)
2023-09-18 04:07:30
![](https://img.aspxhome.com/file/2023/9/114659_0s.png)
Python实现http接口自动化测试的示例代码
2023-05-01 07:14:45
![](https://img.aspxhome.com/file/2023/6/110586_0s.png)
python队列基本操作和多线程队列
2021-01-02 23:28:46
![](https://img.aspxhome.com/file/2023/9/84069_0s.png)
js+html5操作sqlite数据库的方法
2024-01-23 18:31:05
Python文件处理与垃圾回收机制详情
2023-06-14 16:36:17
Django 查询数据库并返回页面的例子
2024-01-15 20:08:37