python函数学习
页页读
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
使用json.dump()与json.dumps()避免一行显示!
json.dump() 与 json.dumps()使用方法如下: # -*- coding:utf-8 -*- # ! ./usr/bin/env python import json jsonpath = 'test.json' data = { "carDark": { "name": "CarDark", "image_files": [ "0001...原创 2019-10-15 21:49:19 · 23308 阅读 · 0 评论 -
np.zeros和np.ones函数总结
形式: np.zeros (shape, dtype, order) Shape: 可以是一维、二维、三维 其中三维,shape = [m , a, b] 表示生成m个a*b的0矩阵; dtype: 默认为float64, 使用形式dtype=np.int;dtype:数据类型,可选参数,默认numpy.float64 t ,位域 b,布尔值,true or false i,整数,如...原创 2018-09-14 17:34:39 · 37820 阅读 · 2 评论 -
用uncompyle2 将.pyc文件还原为.py文件(python2)
源文档README步骤: 1. install uncompiler for .pyc file using https://github.com/wibiti/uncompyle2 2. $ cd /.pyc所在路径 3. $ uncompyle2 -o ./ *.pyc 4. copy the text and save in same folder as *.py 我的...原创 2018-12-26 18:10:03 · 1887 阅读 · 0 评论 -
Python2和3中 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)
转自:https://blog.csdn.net/gaoyueace/article/details/80480925 在加载文件时,python可能出现 ‘ascii’ codec can’t decode byte 0xe4 in position 0: ordinal not in range(128)的问题。对应不同版本的python,有不同的解决方案。 python2 Pyt...转载 2019-04-19 20:24:01 · 1477 阅读 · 0 评论 -
图形中任意位置添加纯文本注释(plt.text)
在图形中任意位置通过text添加纯文本的注释 text所有相关的参数:官网链接 #!/usr/bin/python #coding: utf-8 import numpy as np import matplotlib.pyplot as plt x = np.arange(-10, 11, 1) y = x ** 2 plt.plot(x, y) # 第一个参数是x轴坐标 ...转载 2019-06-01 09:51:55 · 16171 阅读 · 0 评论
分享