- 博客(4)
- 收藏
- 关注
原创 格式归一化
格式归一化def listfiles(rootDir): list_dirs = os.walk(rootdir) for root, dirs, files in list_dirs: for d in dirs: print os.path.join(root,d) for f in files: fileid = f.split('.')[0] filepath = os.path
2021-03-29 16:26:37
203
原创 python基础小练习(3)
1、Write a program which will find all such numbers which are divisible by 7 but are not a multiple of 5, between 2000 and 3200 (both included).The numbers obtained should be printed in a comma-separated sequence on a single line.写一个程序,找出2000到3200之间的所有这些可以
2020-10-15 18:45:12
1026
原创 python基础小练习(2)
1、创建一个1到10的数组,然后逆序输出。import numpy as npn1=np.arange(1,11)n1[::-1]输出为array([10, 9, 8, 7, 6, 5, 4, 3, 2, 1])2、创建一个长度为20的全1数组,然后变成一个4×5的二维矩阵并转置。方法一:import numpy as npb = np.ones(20,dtype=int)b1 = b.reshape(4,5)print(b)
2020-10-13 09:58:31
1619
原创 python基础小练习(1)
python基础小练习(1)1、int(3.14159)==float(3)会输出什么结果? type(int(3.14159))==type(float(3))的结果又是什么? 前后结果是否一样,为什么?int(3.14159)==float(3)type(int(3.14159))==type(float(3))前后结果不一样,因为前者等号两边输出的数值大小都是3,而后者的等号两边输出的数据类型不同,左边为整型,右边为浮点型。2、请使用变量string1 输出 ‘I’ am a stude
2020-10-11 16:21:07
769
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人