ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
``` #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/1/1 0001 下午 03:35 # @Author : 黄药师 # @desc : pandas读取及写入文件 # @File : pandasReadWrite.py # @Software: PyCharm import pandas as pd file=pd.read_csv('people.csv',encoding='gbk') print(file) # 赋值 file.iloc[2,0]='深圳' print(file) # 修改后保存 file.to_csv('people2.csv') ``` ***** people.csv ![](https://box.kancloud.cn/b1c07629a2cba478cad26478e561dc76_365x217.png) people2.csv ![](https://box.kancloud.cn/5c6508813fa3be3fe80599f51277ee0e_429x232.png)