python
来源:互联网 发布:openwrt软件源地址 编辑:程序博客网 时间:2024/06/05 07:49
1.python. write cannot write the file completely, the reason maybe f.close should be f.close()
2. 交互环境下写多行程序,每一行后面加上 ;\
3. 如果df很大,占内存的话。可使用dataframe.drop() 释放内存
4. pandas中,axis=0(default)是按行迭代,axis=1是按列迭代
5.column1 = ['id','o','d']+['TimeWindow' + str(x) for x in range(24, 96)] #生成表头 , 学习list的加法和list中循环生成数字的方法。
6. try:a
except:b 先运行a,如果出错就运行b
7. 使用pd读取没有表头的csv文件: segment_info = pd.read_csv('E:/tt/SZsegment.csv',header=None, names=['a','b','c'])
8,对于没有header,使用空格分割的csv文件,可以这样读取dataframe = pandas.read_csv("housing.csv", delim_whitespace=True, header=None)
0 0
- Python
- Python
- Python
- python
- Python
- PYTHON
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- python
- Python
- 多态中的this参数
- 通过SSH实现 端口映射
- 设置隐藏标题栏
- Ubuntu中的符号
- Java中的接口是什么?
- python
- React Native 之 Natigator与NatigatorIOS使用
- 【BZOJ】2111 [ZJOI2010] Perm 排列计数
- Hibernate与Mybatis对比
- LeetCode 82. Remove Duplicates from Sorted List II
- 安卓让应用程序获得系统权限讲解
- 以终为始
- 串口通信的基本知识
- codeforces contest 738