
python
齐天大圣~~
这个作者很懒,什么都没留下…
展开
-
兩種安裝方式的區別 conda and pip
參考 https://www.anaconda.com/blog/understanding-conda-and-pipComparison of conda and pip conda pip manages binaries wheel or source can require compilers no yes package types any Python-only create environment..原创 2020-08-12 11:03:40 · 113 阅读 · 0 评论 -
Python 3.6 安装 Shapely
按照普通方法确实是无法安装,我尝试了一下,用wheel文件来安装,此方案也通用于其他的库。 1、安装shapely之前安装geos,此处省略,用pip可以直接安装没有问题2、确定电脑中的python版本,在网页链接下载shapely相应的版本3、打开cmd,代码如下...原创 2018-07-16 19:39:22 · 14316 阅读 · 4 评论 -
[python]使用txt保存和读取列表变量
问题:在python实际运用中,我们经常需要将变量保存在txt文件中,并且希望未来能读取他们。这里我们将自定义两个函数,来简化这个操作。解决:1.保存入txt文件输入:content(列表变量),filename(文件名,如'1.txt'),mode(读写方式,默认mode = 'a').输出:在当前目录下创建一个名为filename文件,并且将列表的每个元素逐一写入文件(加...转载 2018-07-18 16:59:33 · 1842 阅读 · 0 评论 -
window10 64位 pycharm 中无法安装PIL库 解决办法
python 3.6.5安装Pillow-PIL,即可。原创 2018-08-01 22:51:22 · 1583 阅读 · 0 评论 -
如何用python解析mnist图片
依赖PIL库直接上源码, 在同目录下 建一个空的文件夹 命名为test,下载好数据集解压。 运行即可。from PIL import Imageimport structdef read_image(filename): f = open(filename, 'rb') index = 0 buf = f.read() f.close() magi...转载 2018-08-01 23:07:48 · 590 阅读 · 0 评论 -
Python 模块
模块(module)在Python中,一个.py文件就是一个模块。通过模块,你可以调用其它文件中的程序引入模块先写一个first.py文件,内容如下:def letter(): print('ABC')再写一个second.py文件,内容如下:import firstfor i in range(10): first.letter()在s...转载 2019-04-01 15:26:02 · 125 阅读 · 0 评论 -
Python报“TypeError: a bytes-like object is required, not ‘str’ ”解决办法
import os,sys#打开文件fd = os.open('foo.txt',os.O_RDWR|os.O_CREAT)str = 'this is fujieace.com test'str = str.encode() //添加转换方法 encode()即可#写入字符串os.write(fd,str)#关闭文件os.close(fd)print('关...转载 2019-04-24 11:19:16 · 1166 阅读 · 0 评论 -
Python 版本 RBF-BP
# -*- coding: utf-8 -*-"""Created on Fri May 18 19:06:27 2018@author: lj"""from numpy import *from math import sqrtdef load_data(file_name): '''导入数据 input: file_name(string):文件的存储位置...转载 2019-06-12 17:34:25 · 1040 阅读 · 0 评论