
python入门与四大科学库
文章平均质量分 61
weixin_41376658
这个作者很懒,什么都没留下…
展开
-
Numpy 基础1-3
Numpy.array np.array([1,2,3,4,5]) print (type(array)) # class ‘numpy.ndarray’ 1.加法,每个值都加 array2 = array + 1 array([3, 4, 5, 6, 7]) 2.乘法,两个ar 对应位置相乘 array = [1,2,3,4,5] array2 * array ar...原创 2018-02-10 20:52:35 · 261 阅读 · 0 评论 -
深度学习中常见的python问题(1)
numpy的argmax argmax常用在CNN中最后的全连接层输出后。 argmax返回的是最大数的索引.argmax有一个参数axis,默认是0,表示第几维的最大值,如果在2维数组中,axis=0表示按列比较的最大值的索引。 如果是三维, import numpy as np a = np.array([ [ ...原创 2018-03-21 14:34:23 · 291 阅读 · 0 评论 -
深度学习中常见的python问题(1)
numpy的argmax argmax常用在CNN中最后的全连接层输出后。 correct_prediction = tf.equal(tf.argmax(finalOutput,1), tf.argmax(y,1)) argmax返回的是最大数的索引.argmax有一个参数axis,默认是0,表示第几维的最大值,如果在2维数组中,axis=0表示按列比较的最大值的索引。 如果...原创 2018-03-26 08:45:30 · 477 阅读 · 0 评论 -
深度学习中遇到的Python问题(二)
1.transpose tf.transpose(inputs, [0, 3, 1, 2]) 原来inputs的维度[0, 1, 2, 3] ,经过上面就转换成[0, 3, 1, 2]了。 2.tf.pad padded_inputs = tf.pad(inputs, [[0, 0], [0, 0],..) ‘t’ is [[1, 2, 3], [4, 5, 6]]. ‘pa...原创 2018-03-26 11:00:21 · 367 阅读 · 0 评论 -
深度学习中遇到的Python问题(四)
1. glob.glob() 该方法的功能与Linux中的ls相似,接受一个Linux式的文件名格式表达式(filename pattern expression),列出所有符合该表达式的文件(与正则表达式类似),将所有文件名放在一个表中返回。所以glob.glob()是一个查询目录下文件的好方法。 path = os.path.join(train_path, fields, '*g')...原创 2018-03-28 19:16:40 · 1117 阅读 · 0 评论 -
Exploratory Data Analysis (Example 1)
concatenate train and test into one dataframe and do all feature engineering using it. traintest = pd.concat([train, test], axis = 0) Dataset cleaning Remove constant features 如果某一特征的值时一样的,就没有意义。 . n...原创 2019-07-15 16:01:45 · 374 阅读 · 0 评论