![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python基础操作
叩钉吧zz
不做没感情的复制粘贴侠
展开
-
【Python】interrupted by signal 9: SIGKILL问题原因
Process finished with exit code 137 (interrupted by signal 9: SIGKILL)问题原因:内存不够 out of RAMTimeoutclose by user or system, such as os.kill(os.getpid(), SIGKILL)参考链接原创 2022-03-16 18:45:52 · 3274 阅读 · 0 评论 -
pymongo读取mongo超时解决办法
报错:pymongo.errors.CursorNotFound: cursor id ‘…’ not valid at server.原因所在:读取mongo的时候超时了。mongo默认有一个时间限制:the cursor is timing out on the server (after 10 minutes of inactivity).解决办法:The last resort will be that you set no_cursor_timeout=True. But you原创 2021-11-17 23:50:20 · 1193 阅读 · 0 评论 -
list遍历方法
借鉴自这篇文献#!/usr/bin/env python# -*- coding: utf-8 -*-if __name__ == '__main__': list = ['html', 'js', 'css', 'python'] # 方法1 print '遍历列表方法1:' for i in list: print ("序号:%s 值:%s" % (list.index(i) + 1, i)) print '\n遍历列表方法2:'原创 2020-12-22 20:35:15 · 81 阅读 · 0 评论 -
CSV文件的读写方法
CSV文件的读写方法1 CSV文件有column可以使用pandas直接按column读取import pandas as pd# 读df = pd.read_csv(data_path)df.columns """>>'cat' 'label' 'texts' """df['cat'] """>> 返回一个很长的list """# 写:dataframe = pd.DataFrame({"column1":list1,"column2":list2}原创 2020-12-22 20:33:08 · 2102 阅读 · 0 评论