python函数学习
页页读
这个作者很懒,什么都没留下…
展开
-
使用json.dump()与json.dumps()避免一行显示!
json.dump() 与 json.dumps()使用方法如下:# -*- coding:utf-8 -*-# ! ./usr/bin/env pythonimport jsonjsonpath = 'test.json'data = { "carDark": { "name": "CarDark", "image_files": [ "0001...原创 2019-10-15 21:49:19 · 19208 阅读 · 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.float64t ,位域b,布尔值,true or falsei,整数,如...原创 2018-09-14 17:34:39 · 37490 阅读 · 2 评论 -
用uncompyle2 将.pyc文件还原为.py文件(python2)
源文档README步骤:1. install uncompiler for .pyc file using https://github.com/wibiti/uncompyle22. $ cd /.pyc所在路径3. $ uncompyle2 -o ./ *.pyc4. copy the text and save in same folder as *.py我的...原创 2018-12-26 18:10:03 · 1675 阅读 · 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,有不同的解决方案。python2Pyt...转载 2019-04-19 20:24:01 · 1384 阅读 · 0 评论 -
图形中任意位置添加纯文本注释(plt.text)
在图形中任意位置通过text添加纯文本的注释text所有相关的参数:官网链接#!/usr/bin/python#coding: utf-8 import numpy as npimport matplotlib.pyplot as plt x = np.arange(-10, 11, 1)y = x ** 2 plt.plot(x, y) # 第一个参数是x轴坐标...转载 2019-06-01 09:51:55 · 15858 阅读 · 0 评论