2020年6月27日

Pandas 速查手册

摘要: Pandas 是一个强大的分析结构化数据的工具集,它的使用基础是 Numpy(提供高性能的矩阵运算),用于数据挖掘和数据分析,同时也提供数据清洗功能。 本页收集了 Python 数据分析库 Pandas 及相关工具的日常使用方法,备查,持续更新中。 缩写说明: df:任意的 Pandas DataF 阅读全文

posted @ 2020-06-27 19:46 pencil2001 阅读(632) 评论(0) 推荐(0)

python-examples

摘要: 主要章节和小节重新按照如下逻辑划分: 一、Python基础 1 数字 2 字符串 3 列表 4 流程控制 5 编程风格 6 函数 7 输入和输出 8 数据结构 9 模块 10 错误和异常 11 类和对象 二、Python模块 1 时间模块 2 文件操作 3 常见迭代器 4 yield 用法 5 装饰 阅读全文

posted @ 2020-06-27 09:06 pencil2001 阅读(1278) 评论(0) 推荐(0)

图像的数组表示

摘要: from PIL import Imageimport numpy as npimport numpy.core.numeric as _nximport matplotlib.pyplot as pltimage_name = 'Lenna_(test_image).png'image_name_ 阅读全文

posted @ 2020-06-27 07:44 pencil2001 阅读(493) 评论(0) 推荐(0)

gradient函数

摘要: import numpy as npimport numpy.core.numeric as _nxdef gradient(f, *varargs, **kwargs): print("***************************************") # 将类数组转换成数组 f 阅读全文

posted @ 2020-06-27 07:42 pencil2001 阅读(1016) 评论(0) 推荐(0)

Scrapy爬虫

摘要: 一、Scrapy爬虫的使用步骤 二、Scrapy爬虫框架结构 三、产生步骤 阅读全文

posted @ 2020-06-27 07:38 pencil2001 阅读(101) 评论(0) 推荐(0)

yield关键字的使用

摘要: '''yield关键字的使用:yield关键字:yield < > 生成器生成器是一个不断产生值的函数yield语句的函数就是一个生成器生成器每次产生一个值(yield语句),函数被冻结,被唤醒后再产生一个值。为何要有生成器?生成器相比一次列出所有内容的优势 1、更节省存储空间 2、响应更迅速 3、 阅读全文

posted @ 2020-06-27 07:35 pencil2001 阅读(77) 评论(0) 推荐(0)

BeautifulSoup4-介绍

摘要: import requestsfrom bs4 import BeautifulSoup # r = requests.get("https://python123.io/ws/demo.html")# demo = r.text demo = """<html><head><title>This 阅读全文

posted @ 2020-06-27 07:32 pencil2001 阅读(135) 评论(0) 推荐(0)

BeautifulSoup4-提取HTML中所有URL链接

摘要: ''' 提取HTML中所有URL链接 ''' import requestsfrom bs4 import BeautifulSoupimport re # r = requests.get("https://python123.io/ws/demo.html")# demo = r.text de 阅读全文

posted @ 2020-06-27 07:31 pencil2001 阅读(2269) 评论(0) 推荐(0)

正则表达式的元字符

摘要: import reprint(" 匹配单个字符 ")r'''. 匹配除换行符以外的任意字符[0123456789] []是字符集和,表示匹配方括号中所包含的任意一个字符[abcd] 匹配'a', 'b', 'c', 'd'中任意一个字符[a-z] 匹配任意小写字母[A-Z] 匹配任意大写字母[0-9 阅读全文

posted @ 2020-06-27 07:28 pencil2001 阅读(257) 评论(0) 推荐(0)

redis命令介绍

摘要: 一、String 概述:String是redis最基本的类型,最大能存储512MB的数据, String类型是二进制安全的,即可以存储任何数据、比如数字、照片、序列化对象等。 1、设置 a、设置键值 set key value b、设置键值及过期时间,以秒为单位 setex key seconds 阅读全文

posted @ 2020-06-27 07:19 pencil2001 阅读(63) 评论(0) 推荐(0)

mongodb初学

摘要: 一、操作mongodb数据库 1、创建数据库 语法:use 数据库名 说明:如果数据库不存在则创建数据库,否则切换到指定的数据库 注意:如果刚刚创建的数据库不在列表内,如果要显示它,我们需要向刚刚创建的数据库中插入一些数据 ( db.student.insert({name:"tom", age:1 阅读全文

posted @ 2020-06-27 07:08 pencil2001 阅读(139) 评论(0) 推荐(0)

导航