![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Faith_yu
这个作者很懒,什么都没留下…
展开
-
读写csv文件
在使用Python对文件操作的过程中,你肯定碰到过对csv文件的操作,下面就python对csv文件的操作进行详述。CSV(Comma-Separated Values)逗号分隔符,也就是每条记录中的值与值之间是用分号分隔的。一, 打开CSV文件并写入一行数据>import csv>c=open("url.csv","w")>writer=csv.write(c)>writer.writero转载 2017-02-20 10:46:16 · 472 阅读 · 0 评论 -
python pandas 对时间序列文件处理代码
import pandas as pdfrom numpy import *import matplotlib.pylab as pltimport copydef read(filename): dat=pd.read_csv(filename,iterator=True) loop = True chunkSize = 1000000 R=[]原创 2017-02-20 10:48:19 · 2070 阅读 · 0 评论 -
python 判断文件夹是否存在
>>> import os>>> os.path.exists('d:/assist')True>>> os.path.exists('d:/assist/getTeacherList.py')True>>> os.path.isfile('d:/assist')False>>> os.path.isfile('d:/assist/getTeacherList.py')True>原创 2017-02-20 11:17:32 · 709 阅读 · 0 评论 -
python pandas修改列属性
使用astype如下:df[[column]] = df[[column]].astype(type)11type即int、float等类型。示例:import pandas as pddata = pd.DataFrame([[1, "2"], [2, "2"]])data.columns = ["one", "two"]print(data)# 当前类型print("----\n修改前类型原创 2017-02-21 11:54:21 · 11620 阅读 · 0 评论 -
error LNK2001: 无法解析的外部符号 __imp__Py_Initialize
Looks like I was trying to link a 64-bit Python library to a 32-bit application. I wish the linker would tell me something other than "unresolved symbol." Linking to the 32-bit library fixes the pro原创 2017-07-12 13:24:56 · 3726 阅读 · 0 评论