python
Judy是coding大王
这个作者很懒,什么都没留下…
展开
-
bashrc文件一不小心折腾到初始设置了
激活python35环境时出错显示:CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate’.激活环境source activate退出环境source deactivate原创 2019-07-15 15:53:14 · 524 阅读 · 0 评论 -
【python】numpy矩阵运算遇到的一些问题
【python】numpy矩阵运算遇到的一些问题1.使用np.concatenate遇到的问题:numpy.AxisError: axis 1 is out of bounds for array of dimension 1解决思路:这个出现的原因坐标1超出了维度.进行拼接的时候,最重要的是维度进行匹配:解决方案:将矩阵的维度进行转换a = np.array([[1, 2], [3, ...原创 2019-08-02 14:15:06 · 1763 阅读 · 1 评论 -
Python中判断是一维数组还是二维数组
如果直接用len,会发现len([1,2,4])为5所以采用.ndim来获取数组维度x = np.array([1, 2, 3, 4])print(x.ndim)最后答案:1原创 2019-09-02 21:29:21 · 9915 阅读 · 0 评论 -
np.dataframe读取数据如何进行转换
问题:’[-1.5195392370224, -0.010261821560561657, -8.885175338946283e-05, -4.48313357992447e-06, 1.0]‘这种str如何转化为array读取解决方案:c = ‘[-1.5195392370224, -0.010261821560561657, -8.885175338946283e-05, -4.48313...原创 2019-09-12 16:26:21 · 570 阅读 · 0 评论 -
Virtualenv如何生成Python2 和Python3 两个环境
1.下载Virtualenv2.cd 到Virtualenv想要搭建的目录下3.如果环境本身是Python2 的环境:$ virtualenv -p /usr/local/bin/python2.7 test搭建Python3的环境的时候:$ virtualenv -p /usr/bin/python3.4 test4.激活环境:$ cd test$ source ./bin/ac...原创 2019-09-23 15:31:29 · 829 阅读 · 0 评论