
Python
AIWCZ
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python 输出图像像素,显示不全的解决
在import包后,加上这一行,完事。 np.set_printoptions(threshold=np.inf)原创 2021-11-05 16:09:43 · 1114 阅读 · 0 评论 -
Python 判断列表中元素是否完全相同
将列表转换成集合即可 a = [0,0,0,0] b = set(a) # {0} if len(b) == 1: # 1 print('True')原创 2021-11-05 10:26:43 · 2986 阅读 · 1 评论 -
Python 删除文件夹及其中所有文件
os只能删除empty的文件夹。 因此: import shutil shutil.rmtree(dirpath)原创 2021-11-04 15:57:41 · 614 阅读 · 0 评论 -
Python中List、numpy.array与torch.Tensor 之间的相互转化
list 与 numpy ①list → numpy array = np.array(list) ②numpy → list list = array.tolist() torch.Tensor 与 numpy ①torch.Tensor → numpy array = tensor.numpy() ②numpy → list tensor = torch.from_numpy(array) list 与 torch.Tensor ①list → tensor tensor = torch.Ten原创 2021-11-04 11:17:14 · 357 阅读 · 0 评论 -
用Python对.mat文件进行读取
import scipy.io as scio dataFile='data/WILLOW-ObjectClass/Car/Cars_000a.mat' data=scio.loadmat(dataFile) print(data)原创 2021-10-24 20:52:07 · 311 阅读 · 0 评论 -
python中lower()函数
lower()函数 将字符串中的所有大写字母转换为小写字母。原创 2021-10-24 17:41:55 · 425 阅读 · 0 评论