2017-7-17ubuntu14.04笔记本系统安装

 http://jingyan.baidu.com/album/eb9f7b6d8536a8869364e813.html?picindex=1  参考网址

HP本本,统一的F10进BIOS界面。
http://jingyan.baidu.com/article/76a7e409bea83efc3b6e1507.html  重要参考 win7和ubuntu共存(其中一个盘)安装完成
安装完成后,wuxian网络驱动
http://jingyan.baidu.com/article/09ea3ede21798cc0aede399f.html  无线设置完成
Ubuntu-Python2.7安装 scipy,numpy,matplotlib,这个工作还没有完成?  开始搞!
之前在windows 下安装过 那几个科学计算的包,由于C++编译器的问题,花了好长时间。这次在Linux下几个命令就可以了。差别好大。
1.
$ sudo apt-get install python-pip python-dev
2.使用apt-get 安装 只需要下面的几个命令即可,亲测可用。 sudo apt-get install python-numpy sudo apt-get install python-scipy sudo apt-get install python-matplotlib
安装成功,测试下
# -*- coding: UTF-8 -*-    
'''
Created on 2016年6月21


@author: Administrator
'''
#print("hello我 world!")
import matplotlib.pyplot as plt
from matplotlib import collections, transforms
from matplotlib.colors import colorConverter
import numpy as np
 
nverts = 50
npts = 100
 
# Make some spirals
r = np.arange(nverts)
theta = np.linspace(0, 2*np.pi, nverts)
xx = r * np.sin(theta)
yy = r * np.cos(theta)
spiral = list(zip(xx, yy))
 
# Make some offsets
rs = np.random.RandomState([12345678])
xo = rs.randn(npts)
yo = rs.randn(npts)
xyo = list(zip(xo, yo))
 
# Make a list of colors cycling through the rgbcmyk series.
colors = [colorConverter.to_rgba(c)
          for c in ('r', 'g', 'b', 'c', 'y', 'm', 'k')]
 
fig, axes = plt.subplots(2, 2)
((ax1, ax2), (ax3, ax4)) = axes  # unpack the axes
 
 
col = collections.LineCollection([spiral], offsets=xyo,
                                 transOffset=ax1.transData)
trans = fig.dpi_scale_trans + transforms.Affine2D().scale(1.0/72.0)
col.set_transform(trans)  # the points to pixels transform
# Note: the first argument to the collection initializer
# must be a list of sequences of x,y tuples; we have only
# one sequence, but we still have to put it in a list.
ax1.add_collection(col, autolim=True)
# autolim=True enables autoscaling.  For collections with
# offsets like this, it is neither efficient nor accurate,
# but it is good enough to generate a plot that you can use
# as a starting point.  If you know beforehand the range of
# x and y that you want to show, it is better to set them
# explicitly, leave out the autolim kwarg (or set it to False),
# and omit the 'ax1.autoscale_view()' call below.
 
# Make a transform for the line segments such that their size is
# given in points:
col.set_color(colors)
 
ax1.autoscale_view()  # See comment above, after ax1.add_collection.
ax1.set_title('LineCollection using offsets')
 
 
# The same data as above, but fill the curves.
col = collections.PolyCollection([spiral], offsets=xyo,
                                 transOffset=ax2.transData)
trans = transforms.Affine2D().scale(fig.dpi/72.0)
col.set_transform(trans)  # the points to pixels transform
ax2.add_collection(col, autolim=True)
col.set_color(colors)
 
 
ax2.autoscale_view()
ax2.set_title('PolyCollection using offsets')
 
# 7-sided regular polygons
 
col = collections.RegularPolyCollection(7,
                                        sizes=np.fabs(xx) * 10.0, offsets=xyo,
                                        transOffset=ax3.transData)
trans = transforms.Affine2D().scale(fig.dpi / 72.0)
col.set_transform(trans)  # the points to pixels transform
ax3.add_collection(col, autolim=True)
col.set_color(colors)
ax3.autoscale_view()
ax3.set_title('RegularPolyCollection using offsets')
 
 
# Simulate a series of ocean current profiles, successively
# offset by 0.1 m/s so that they form what is sometimes called
# a "waterfall" plot or a "stagger" plot.
 
nverts = 60
ncurves = 20
offs = (0.1, 0.0)
 
yy = np.linspace(0, 2*np.pi, nverts)
ym = np.amax(yy)
xx = (0.2 + (ym - yy)/ym)**2 * np.cos(yy - 0.4)*0.5
segs = []
for i in range(ncurves):
    xxx = xx + 0.02*rs.randn(nverts)
    curve = list(zip(xxx, yy*100))
    segs.append(curve)
 
col = collections.LineCollection(segs, offsets=offs)
ax4.add_collection(col, autolim=True)
col.set_color(colors)
ax4.autoscale_view()
ax4.set_title('Successive data offsets')
ax4.set_xlabel('Zonal velocity component (m/s)')
ax4.set_ylabel('Depth (m)')
# Reverse the y-axis so depth increases downward
ax4.set_ylim(ax4.get_ylim()[::-1])
 
 
plt.show()


# from matplotlib import pyplot 
# pyplot.plot([1,2,3,4], [1,4,9,16])
# pyplot.show()
出现的问题主要集中在
matplotlib
这个模块,在UBUNTU 14.04 Eclipse+pydev 中显示一直是modules not resoved
问题在于
matplotlib
这个模块存放的位置在/usr/lib/pymodules/python2.7
跟numpy scipy不一样
要想在ECLIPSE中显示正常,需要把
/usr/lib/pymodules/python2.7
加到python interpreateer/grammer中
F:\深度学习资料\机器学习为何用Python 中有个PDF
python如何看模块说明的,查模块位置
1) 
help('模块名'): 是看模块说明的

解决Eclipse Pydev中import时报错:Unresolved import

解决方法如下:

1.在project(watip)右击打开菜单 ->选择properties->选择"PyDev-Interpreter/Grammar"->点击链接"Click here to configure an interpreter not listed." -> 在"Libraries"tab内,点击"new folder",加入util的上引目录"src"的路径->点击"ok"

3.重启eclipse.

 
 
 
 
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值