科学网

 找回密码
  注册
压缩文件,解压文件,并读取
夏江江 2018-4-12 22:18
import numpy import random import gzip rr = numpy.array( ).reshape(2000, 5000) # npz numpy.savez('rrr',mingzi = rr) # write with gzip.open('rrr_int.gz', 'wb')as f: numpy.savetxt(f, rr) # read with gzip.open('rrr_int.gz', ' ...
个人分类: python|2082 次阅读|没有评论
python 解压文件.bz2
夏江江 2018-1-4 15:14
import sys import os import bz2 from bz2 import decompress path = M:/data/CMORPH_V1.0/unzip_example/zip un_path=M:/data/CMORPH_V1.0/unzip_example/unzip for(dirpath,dirnames,files)in os.walk(path): for f ...
个人分类: python|6365 次阅读|没有评论
SOM安装 Self Organizing Map for python
夏江江 2017-12-6 13:57
for windows pip install git+ https://github.com/compmonks/SOMPY.git 安装好以后在C:\Python35\Lib\site-packages路径下的名字是SOMPY-1.0-py3.5.egg 重命名为SOMPY-1.0-py3.5.zip 右键点击解压 生成sompy 文件夹 进入其中,找到s ompy.py 和 mapview.py这两个文件 分别将两个文件中的import ipdb ...
个人分类: python|6163 次阅读|没有评论
拷贝文件-shutil
夏江江 2017-11-10 15:36
import shutil import os path_old = 'M:/data/ec/' # path_new = 'M:/data/ec_new/' #保证这个路径下什么都没有! for i in os.listdir(path_old): oldname = path_old+i+'/ecmwf' newname = path_new+i+ ...
个人分类: python|1324 次阅读|没有评论
python安装pymysql
夏江江 2017-11-10 14:10
pymsql是Python中操作MySQL的模块,其使用方法和MySQLdb几乎相同。但目前pymysql支持python3.x而后者不支持3.x版本。 也就是说在python3.x时,要安装pymysql 而不是mysql 如果python3.x安装mysql,再import MySQLdb时, 提示错误
个人分类: python|2444 次阅读|没有评论
linux 普通用户python中import pyeemd失败
夏江江 2017-11-9 16:51
在root用户下, #python 进入python命令, import pyeemd pyeemd.__file__ 发现这个文件的路径: '/root/.local/lib/python3.6/site-packages/pyeemd-1.4-py3.6.egg/pyeemd/__init__.py' 切换至普通用户下, #python 进入python命令, import sys sy ...
个人分类: python|2822 次阅读|没有评论
python下安装eemd
夏江江 2017-9-2 10:43
以下是 windows系统 python下的安装: 基本是参考网站: http://juiceyang.com/2016/03/24/how-to-install-pyeemd-on-windows-in-3-steps/ (1)值得注意的是,在安装的时候,最好用右键选择“管理员身份运行”MinGW (2)MinGW中安装git命令: 四、安装 Git搜索 gitpacman -Sl |grep git 安装 MSYS ...
个人分类: python|5591 次阅读|没有评论
Kivy-- [CRITICAL] [App] Unable to get a Window, abort.
夏江江 2017-6-25 13:52
It took me a whole day to fix this problem.WhenI run the simplest kivy example .py errors show as flowing, .... Unable to find any valuable Window provider. .... Unable to get a Window, abort. Finally, it works after a lot of trials.But honestly, I don't know the cause ...
个人分类: python|6427 次阅读|没有评论

本页有 2 篇博文因作者的隐私设置或未通过审核而隐藏

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-28 15:40

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部