随笔分类 -  python

1 2 3 下一页

np.dot ValueError: operands could not be broadcast together with shapes (2,2) (2,3)
摘要:https://www.statology.org/operands-could-not-be-broadcast-together-with-shapes/ ValueError: operands could not be broadcast together with shapes (2,2) 阅读全文

posted @ 2022-05-18 14:36 cdekelon 阅读(271) 评论(0) 推荐(0) 编辑

codespell
摘要:1. Install codespell pip install codespell 2. Download dictionary to a folder, e.g. ~/dictionary.txt3. Git clone git clone xxx.git 3. Check docs files 阅读全文

posted @ 2022-04-14 14:09 cdekelon 阅读(101) 评论(0) 推荐(0) 编辑

pycocotools
摘要:!pip3 install pycocotools==2.0.2 阅读全文

posted @ 2022-02-17 15:36 cdekelon 阅读(11) 评论(0) 推荐(0) 编辑

pass list type to os.system sorted list
摘要:import os import glob file_list = [] for i in sorted(glob.glob('/workspace/asr_mandarin/aishell_converted_test/wavs/*.wav')): file_list.append(i) comm 阅读全文

posted @ 2021-10-21 18:39 cdekelon 阅读(13) 评论(0) 推荐(0) 编辑

sorted after glob , sort
摘要:filepaths = list(sorted(glob.glob(os.path.join(cfg.audio_dir, f"*.{cfg.audio_type}")))) 阅读全文

posted @ 2021-10-21 11:23 cdekelon 阅读(12) 评论(0) 推荐(0) 编辑

save 中文 to a json file
摘要:https://qastack.cn/programming/18337407/saving-utf-8-texts-in-json-dumps-as-utf8-not-as-u-escape-sequence with open('filename', 'w', encoding='utf8') 阅读全文

posted @ 2021-10-20 17:37 cdekelon 阅读(32) 评论(0) 推荐(0) 编辑

untar several tar.gz files
摘要:import osimport glob folder = './wav' for i in glob.glob(folder + "/" + "*.tar.gz"): #print(i) os.system("sudo tar xvf %s -C untar" %(i)) 阅读全文

posted @ 2021-08-12 23:21 cdekelon 阅读(29) 评论(0) 推荐(0) 编辑

What does -> mean in Python function definitions?
摘要:https://stackoverflow.com/questions/14379753/what-does-mean-in-python-function-definitions https://www.python.org/dev/peps/pep-3107/ Wow, I missed qui 阅读全文

posted @ 2021-07-23 14:17 cdekelon 阅读(41) 评论(0) 推荐(0) 编辑

reshape(-1) reshape(1,-1)
摘要:https://blog.csdn.net/qq_29831163/article/details/90112000 https://blog.csdn.net/mingyuli/article/details/81040661 阅读全文

posted @ 2021-03-10 00:58 cdekelon 阅读(60) 评论(0) 推荐(0) 编辑

@property的介绍与使用
摘要:From : https://zhuanlan.zhihu.com/p/64487092 python @property的介绍与使用 python @property的介绍与使用 python的@property是python的一种装饰器,是用来修饰方法的。 作用: 我们可以使用@property 阅读全文

posted @ 2021-02-20 00:11 cdekelon 阅读(134) 评论(0) 推荐(0) 编辑

X[:,0]和X[:,1]
摘要:https://blog.csdn.net/a394268045/article/details/79104219 X[:,0]是numpy中数组的一种写法,表示对一个二维数组,取该二维数组第一维中的所有数据,第二维中取第0个数据,直观来说,X[:,0]就是取所有行的第0个数据, X[:,1] 就是 阅读全文

posted @ 2021-02-19 22:55 cdekelon 阅读(306) 评论(0) 推荐(0) 编辑

sorted(列表)
摘要:https://blog.csdn.net/viviliao_/article/details/79521577 阅读全文

posted @ 2021-02-09 23:13 cdekelon 阅读(52) 评论(0) 推荐(0) 编辑

pad image to 512x512
摘要:for line in fp: filename = (str(int_counter)+".jpeg") line_array = line.split(" ") img = Image.open(os.path.join(root_dir, line_array[2], line_array[3 阅读全文

posted @ 2021-01-25 09:53 cdekelon 阅读(58) 评论(0) 推荐(0) 编辑

凤凰财经
摘要:https://github.com/wdxgy136/fortunedog 凤凰财经获取月,周,日级别数据: 月数据: http://api.finance.ifeng.com/akmonthly/?code=sz000002&type=last 周数据: http://api.finance.i 阅读全文

posted @ 2020-08-01 17:30 cdekelon 阅读(832) 评论(0) 推荐(0) 编辑

generate h264 based on 100 image
摘要:1. Generate test sources: image and its h264 file. - copy 1 images for 100 times. import shutil source = "./1.png" for i in range(2,100): target = "./ 阅读全文

posted @ 2020-05-17 14:56 cdekelon 阅读(130) 评论(0) 推荐(0) 编辑

插入shell
摘要:https://www.jianshu.com/p/5d999a668e79 import subprocess print subprocess.call("service apache2 status", shell=True) import os print os.system("servic 阅读全文

posted @ 2020-05-09 19:36 cdekelon 阅读(168) 评论(0) 推荐(0) 编辑

show all the files under one folder
摘要:import osdef countFile(dir): tmp = 0 for item in os.listdir(dir): if os.path.isfile(os.path.join(dir, item)): tmp += 1 else: tmp += countFile(os.path. 阅读全文

posted @ 2020-04-21 16:46 cdekelon 阅读(133) 评论(0) 推荐(0) 编辑

os.walk
摘要:列出所有文件的完整路径。 import os import glob imagenet_dir = "/dataset/" for root,dirs,files in os.walk(imagenet_dir): for f in files: print(os.path.join(root,f) 阅读全文

posted @ 2020-01-10 17:56 cdekelon 阅读(167) 评论(0) 推荐(0) 编辑

找出jpg 和 json, 并copy到 一个新的文件夹
摘要:$ cat filter.py import os import sys from os import walk from os import listdir import glob from shutil import copy2 mypath = './' dst = './test' #jpgs = glob.glob(os.path.join(mypath, '*.jpg')) ... 阅读全文

posted @ 2019-10-16 11:07 cdekelon 阅读(143) 评论(0) 推荐(0) 编辑

http://www.runoob.com
摘要:http://www.runoob.com 阅读全文

posted @ 2019-03-20 10:30 cdekelon 阅读(304) 评论(0) 推荐(0) 编辑

1 2 3 下一页
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

导航

统计

点击右上角即可分享
微信分享提示