会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
青春叛逆者
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
16
17
18
19
20
21
22
23
24
···
31
下一页
2019年1月9日
TypeError: only size-1 arrays can be converted to Python scalars
摘要: Traceback (most recent call last): File "/Users/mac126/数据分析/mayplotlib/mayplotlib.py", line 50, in <module> plt.text(x,y ,'%.2f'%y ,ha='center',va='bo
阅读全文
posted @ 2019-01-09 10:28 青春叛逆者
阅读(21661)
评论(0)
推荐(1)
2019年1月8日
mongodb 命令补充
摘要: 根据条件查找数据 ----------------------- 通过条件查询: db.foo.find( { x : 77 } , { name : 1 , x : 1 } ) ----------------------------- db.foo.find(...).count() db.foo.find(...).limit(n) 根据条件查找数据并返回...
阅读全文
posted @ 2019-01-08 21:10 青春叛逆者
阅读(277)
评论(0)
推荐(0)
padnas 入门教程
摘要: # encoding=utf-8 import pandas as pd from pylab import mpl import matplotlib.pyplot as plt from matplotlib import font_manager #在数据挖掘前一个数据分析、筛选、清理的多功能工具 #将excel读取并转换为pandas的DataFrame #pd.read_csv读取...
阅读全文
posted @ 2019-01-08 16:07 青春叛逆者
阅读(423)
评论(0)
推荐(0)
bytes 与 str的传说
摘要: bytes对象只负责以二进制字节序列的形式记录所需记录的对象,至于该对象到底表示什么(比如到底是什么字符)则由相应的编码格式解码所决定 Python2 中 Python3 中 bytes是Python 3中特有的,Python 2 里不区分bytes和str。 python3中:str 使用enco
阅读全文
posted @ 2019-01-08 13:49 青春叛逆者
阅读(175)
评论(0)
推荐(0)
日志logging
摘要: Scrapy提供了log功能,可以通过 logging 模块使用。 可以修改配置文件settings.py,任意位置添加下面两行,效果会清爽很多。 Log levels Scrapy提供5层logging级别: CRITICAL - 严重错误(critical) ERROR - 一般错误(regul
阅读全文
posted @ 2019-01-08 10:44 青春叛逆者
阅读(226)
评论(0)
推荐(0)
2019年1月7日
TypeError: a bytes-like object is required, not 'str'
摘要:
阅读全文
posted @ 2019-01-07 14:00 青春叛逆者
阅读(291)
评论(0)
推荐(0)
scrapy 爬虫保存数据
摘要: scrapy保存信息的最简单的方法主要有四种,-o 输出指定格式的文件,,命令如下: # json格式,默认为Unicode编码 scrapy crawl itcast -o teachers.json # json lines格式,默认为Unicode编码 scrapy crawl itcast -o teachers.jl # csv 逗号表达式,可用Excel打开 scrapy cra...
阅读全文
posted @ 2019-01-07 13:25 青春叛逆者
阅读(793)
评论(0)
推荐(0)
FileNotFoundError: File b'score.xlsx' does not exist
摘要: 一条命令解决excel 不能读取问题
阅读全文
posted @ 2019-01-07 10:03 青春叛逆者
阅读(1276)
评论(0)
推荐(0)
2019年1月5日
图片截取
摘要: from PIL import Image ''' 截取图像的某个部分: 我们还可以使用Image类中的crop方法截取图像的一部分长方形区域。下面的源 代码展示了打开当前目录下的python.jpg的文件,从中截取长方形中央区域并保存为 python_ cropjpg文件的功能。 crop方法的参数是截取长方形区域的左上角和右下角的坐标,是-个包含四个 元素的元组,并将截取的图像以一个Imag...
阅读全文
posted @ 2019-01-05 21:01 青春叛逆者
阅读(272)
评论(0)
推荐(0)
图像过滤器
摘要: from PIL import Image #图像过滤处理 ''' 对图像进行过滤处理需要获取图像的像素值。图像的像素值可以通过Image类的getdata 方法和getpixel方法获得。所得到的像素信息在数值上是以0 -255的整数表示, 按照R (红色)、G (绿色)、B (蓝色)的顺序依次排列,整体作为-一个元组。下面 的源代码展示了打开当前目录下python.jpg的文件,将该图像的像...
阅读全文
posted @ 2019-01-05 20:58 青春叛逆者
阅读(576)
评论(0)
推荐(0)
上一页
1
···
16
17
18
19
20
21
22
23
24
···
31
下一页
公告