随笔分类 -  python语言

matplotlib常见操作
摘要:import osimport numpy as npfrom PIL import Imageimport matplotlib.pyplot as plt img = Image.open(os.path.join('images', 'cat' + '.jpg'))gray = img.con 阅读全文

posted @ 2019-08-04 11:32 冬天里暖阳 阅读(110) 评论(0) 推荐(0)

PIL pip error
摘要:结果显示: 提示——Could not find a version that satisfies the requirement PIL (from versions: )No matching distribution found for PIL 错误原因: 现在已经用Pillow代替PIL,P 阅读全文

posted @ 2019-05-20 11:55 冬天里暖阳 阅读(151) 评论(0) 推荐(0)

No module named PIL
摘要:ImportError: No module named PIL 错误 的解决方法: 安装Pillow: [html] view plain copy pip install Pillow [html] view plain copy [html] view plain copy 阅读全文

posted @ 2019-05-11 13:49 冬天里暖阳 阅读(3663) 评论(0) 推荐(0)

python字符串处理内置方法一览表
摘要:python字符串处理内置方法一览表 序号方法及描述 1 capitalize()将字符串的第一个字符转换为大写 2 center(width, fillchar) 返回一个指定的宽度 width 居中的字符串,fillchar 为填充的字符,默认为空格。 3 count(str, beg= 0,e 阅读全文

posted @ 2019-04-25 21:12 冬天里暖阳 阅读(217) 评论(0) 推荐(0)

python 类型转换
摘要:python3 字典、列表、数组和字符串之间的相互转化 2018年06月05日 00:01:51 zhangyu4863 阅读数:49366 python3 字典、列表、数组和字符串之间的相互转化 2018年06月05日 00:01:51 zhangyu4863 阅读数:49366 python3 阅读全文

posted @ 2019-04-09 10:56 冬天里暖阳 阅读(140) 评论(0) 推荐(0)

Python集合操作
摘要:引用于:https://www.cnblogs.com/chaoren399/p/4858253.html 本文章主要对于集合的一些简单操作 集合分为可变集合与不可变集合 可变集合(不可hash) s={1,'a',(1,2,3),} #等同于set({1,'a',(1,2,3),}) 添加值 s= 阅读全文

posted @ 2019-03-26 20:38 冬天里暖阳 阅读(401) 评论(0) 推荐(0)

计算Python运行时间
摘要:可以调用datetime 或者 time库实现得到Python运行时间 方法1 import datetime start_t = datetime.datetime.now() #运行大型代码 end_t = datetime.datetime.now() print ((end_t - star 阅读全文

posted @ 2019-03-18 10:49 冬天里暖阳 阅读(4343) 评论(0) 推荐(0)

np.expand_dims()
只有注册用户登录后才能阅读该文。

posted @ 2019-02-15 19:39 冬天里暖阳

os.path.basename
只有注册用户登录后才能阅读该文。

posted @ 2019-02-11 11:15 冬天里暖阳 阅读(0) 评论(0) 推荐(0)

python @classmethod
该文被密码保护。

posted @ 2019-02-11 11:05 冬天里暖阳

numpy数组 转为列表
只有注册用户登录后才能阅读该文。

posted @ 2019-02-11 10:46 冬天里暖阳 阅读(1) 评论(0) 推荐(0)

类型转换
该文被密码保护。

posted @ 2019-02-11 10:35 冬天里暖阳 阅读(0) 评论(0) 推荐(0)

类型转换
摘要:int("123") 123 int("3f",16) 63 bytes([72,9,64]) b'H\t@' list("abc") ['a', 'b', 'c'] set(["one","two"]) {'one','two'} [int(x) for x in ('1','29','-3')] 阅读全文

posted @ 2019-02-01 21:13 冬天里暖阳 阅读(86) 评论(0) 推荐(0)

python 中 类型转换 bytes
摘要:https://www.cnblogs.com/sesshoumaru/p/5980090.html 阅读全文

posted @ 2019-02-01 21:04 冬天里暖阳 阅读(774) 评论(0) 推荐(0)

常见的打开图片
摘要:用matplotlib打开图片,展示图片,转灰度,展示一个维度 import matplotlib.pyplot as plt # plt 用于显示图片import numpy as np import matplotlib.image as mpimg dog = mpimg.imread('do 阅读全文

posted @ 2019-01-27 12:48 冬天里暖阳 阅读(252) 评论(0) 推荐(0)

python常见的数据结构
摘要:https://www.cnblogs.com/5poi/p/7466760.html 阅读全文

posted @ 2019-01-25 22:03 冬天里暖阳 阅读(123) 评论(0) 推荐(0)

导航