python
-
使用paddle报错提示:Could not locate zlibwapi.dll.
跑Paddle时候报错,Could not locate zlibwapi.dll. Please make sure it is in your library path 。这句话的意思是“找不到zlibwapi.dll。请确保它在您的库路径中”。
所以,我们需要下载zlibwapi.dll,下载地址https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#install-zlib-windows,进入界面后点击下图圈起来的地方,下载文件
... -
numpy中max与min函数有什么用?
numpy中max与min函数作用其实就是取最大值与最小值。都有一个参数axis,当axis=0时,取所有列最大值或者最小值,axis=1时取所有行最大或者最小值。
比如说
a = np.array([[1,2,3],[3,4,5],[4,5,6]])
取a的最大值,最小值
... -
飞桨paddlepaddle安装过程中遇到的问题总结
在安装飞桨paddlepaddle遇到了几个问题:
一、提示如下错误
...ERROR: Could not find a version that satisfies the requirement paddlepaddle-gpu==2.4.1 (from versions: none)
ERROR: No matching distribution found for paddlepaddle-gpu==2.4.1
-
python如何将阿拉伯数字转为汉子数字,1到99
在Python中如果想将阿拉伯数字转为汉子数字,是没有现成的函数的,只能自己写了,今天在写一个程序时需要用到,所以就写了一个1到10阿拉伯数字转为汉子数字,现在将源程序代码放在下面,供大家参考:
import re fo=open('基础/地址.txt',encoding='utf-8') strs=fo.read() strs=re.sub('\n','',strs) str_list=strs.split(' ') item={} i=0 hanzi_list = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'] imgnum = 1 i=0 while i<len(str_list): # while i<110: if imgnum // 10 == 0: new_num_str = hanzi_list[imgnum - 1] elif imgnum // 10 == 1: if imgnum % 10 == 0: new_num_str = '十' else: new_num_str = f'十{hanzi_list[imgnum % 10 - 1]}' elif imgnum//10<10: if imgnum % 10 == 0: new_num_str = f'{hanzi_list[imgnum // 10 - 1]}十' else: new_num_str = f'{hanzi_list[imgnum // 10 - 1]}十{hanzi_list[imgnum % 10 - 1]}' if i==0: print("%s、%s"%(new_num_str,str_list[i+2])) print("地址:%s"%str_list[i+3]) str_list[i+4]=re.sub('周六','\n周六',str_list[i+4]) print("工作时间:\n%s"%str_list[i+4]) i+=5 else: print("%s、%s"%(new_num_str,str_list[i+1])) print("地址:%s"%str_list[i+2]) str_list[i+3]=re.sub('周六','\n周六',str_list[i+3]) print("工作时间:\n%s"%str_list[i+3]) i+=4 imgnum+=1
... -
numpy.frombuffer函数
numpy.frombuffer 用于实现动态数组。
numpy.frombuffer 接受 buffer 输入参数,以流的形式读入转化成 ndarray 对象。
numpy.frombuffer(buffer, dtype = float, count = -1, offset = 0)
... -
numpy.array函数
介绍
ndarry是numpy的N维数组对象,它是一系列同类型数据的集合,以0下标为开始进行集合中元素的索引。与它相似的有numpy.asarray,只不过numpy.asarray只有三个参数。
numpy.array(object, dtype=None, copy=True, order='K', subok=False, ndmin=0)
... -
numpy.asarray函数详解
numpy.asarray 类似 numpy.array,但 numpy.asarray 参数只有三个,比 numpy.array 少两个。
numpy.asarray(a, dtype = None, order = None)
... -
python全局变量的使用与访问
Python中,全局变量可以在函数外定义,也可以在函数内定义,具体实例代码如下:
一、在函数外申明全局变量
a=1 b=3 def m(): print(a,b) if __name__=='__main__': m()
... -
numpy中reshape函数用法详解
numpy中reshape函数的三种常见相关用法
reshape(m,n) ,将数组转换成 m 行,n 列
reshape(m,-1),将数组转换成 m 行
reshape(-1,n),将数组转换成 n 列
一、reshape(m,n),将数组转换成m行,n列,语法如下
...