MATlinux安装matplotlib失败405

君,已阅读到文档的结尾了呢~~
THIES染缸除了低浴比外,还采用独特的流量控制技术.计算的实际流量值和自动生成的目标流量值进行比较,如果流量偏小,则PID比例积分控制功能块增大输出给变频器的MOTOR ...
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
Thies染缸常见故障检查及维护指南
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口ssp405_1.4L 90KW TSI涡轮增压发动机_图文_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
ssp405_1.4L 90KW TSI涡轮增压发动机
&&汽车维修资料
阅读已结束,下载文档到电脑
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,方便使用
还剩29页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢相关文章推荐
邻近算法,或者说K最近邻(kNN,k-NearestNeighbor)分类算法可以说是整个数据挖掘分类技术中最简单的方法了。所谓K最近邻,就是k个最近的邻居的意思,说的是每个样本都可以用她最接近的k个...
http://blog.csdn.net/zhaocj/article/details/
K近邻算法(KNN,K-NearestNeighbors)是一种非常简单的机...
转自:http://blog.csdn.net/lyflower/article/details/1728642
文本分类中KNN算法,该方法的思路非常简单直观:如果一个样本在特征空间中的k个...
K-近邻(K-Nearest Neighbors, KNN)是一种很好理解的分类算法,简单说来就是从训练样本中找出K个与其最相近的样本,然后看这K个样本中哪个类别的样本多,则待判定的值(或说抽样)就属...
K-近邻(K-Nearest Neighbors, KNN)是一种很好理解的分类算法,简单说来就是从训练样本中找出K个与其最相近的样本,然后看这K个样本中哪个类别的样本多,则待判定的值(或说抽样)就属...
Image Classification图像分类Motivation. 这一节我们将介绍图像分类的问题,也就是在一套固定的种类集中,给一副输入图像指定一个标签。这也是计算机视觉的一个核心问题,虽然它听...
他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)对于各种注解而言,排第一的当然是&@Controller&,表明某类是一个controller. &@RequestMapping&请求路径映射,如果标注在某个controller的类级别上,则表明访问此类路径下的方法都要加上其配置的路径:最常用是标注在方法上,表明哪个具体的方法来接受处理某次请求. @Controller @RequestMapping(value=&/book&) public class BookController { @
This article is reproduced from the I CSDN blog: http://blog.csdn.net/ctojxzsycztao/archive//4169237.aspx First of all, SPRING and HIBERNATE need to prepare for the JAR corresponding package in the ECLIPSE project to create a new WEB, SPRIN
From Address: https: / / /developerworks/cn/java/j-lo-spring25-mvc/ A simple annotation-based Controller The use of low version of the Spring MVC readers know: When you create a Controller, we need to directly or indirectly, to achieve org
A simple annotation-based Controller The use of low version of the Spring MVC readers know: When you create a Controller, we need to directly or indirectly, to achieve org.springframework.web.servlet.mvc.Controller interface. Under normal circumstanc
spring 2.5 a lot of use of the mvc annotations, reducing the xml configuration file, so that spring to use more simple and In the following I have a spring 2.5 mvc annotations an ajax implementation. LEI Wu Luan First, look at the class action config
&%@ page language=&java& import=&java.util.*& pageEncoding=&UTF-8&%& &%@ include file=&FusionCharts.jsp& %& &HTML& &HEAD& &TITLE&FusionCharts - Simple Column 3D Chart&/TITLE& &
&%@ page language=&java& import=&java.util.*& pageEncoding=&UTF-8&%& &%@ include file=&FusionCharts.jsp& %& &HTML& &HEAD& &TITLE&FusionCharts - Simple Column 3D Chart&/TITLE& &
edit_grid.js Ext.onReady(function() { //grid The check box in the var sm = new Ext.grid.CheckboxSelectionModel(); // Data storage var ds = new Ext.data.Store({ proxy : new Ext.data.HttpProxy({ url : &../zdbnr.action?method=page&, method : &
1.Ext code //formPanel The form of attribute fileUpload: true, // Upload files // Upload file form { fieldLabel : ' Upload files ', name : 'uploadphoto', inputType : 'file' } 2.springMVC controller @RequestMapping(params = &method=insert&) publi
Ext.onReady(function() { // grid The check box in the var sm = new Ext.grid.CheckboxSelectionModel(); // Data storage var ds = new Ext.data.Store({ proxy : new Ext.data.HttpProxy({ url : &../student.action?method=page&, method : &
Spring from the built-in support for web applications multipart file uploads. multipart support is designed by defining org.springframework.web.multipart package plug-in object MultipartResovler to complete. Spring provides support for Commons FileUp
http://www./j2ee/.asp # N10059 This article includes: Outline A simple annotation-based Controller Listing 3. Annomvc-servlet.xml URL to a Controller handle multiple requests Listing 3. Each corresponding to a URL request handling
A simple annotation-based Controller Low version of the Spring MVC to use the readers to know: When you create a Controller, we need to directly or indirectly, to achieve org.springframework.web.servlet.mvc.Controller interfaces. In general, we are t
Following an overview of Spring MVC Spring 2.0 On major upgrade, Spring 2.5 has introduced for the Spring MVC annotation-driven features. Now you do not need to Controller inherit any interface, no configuration file is defined in the XML request and
&!-- tree view --& &link rel=&stylesheet& href=&/plugin/jquery-treeview/jquery.treeview.css& type=&text/css&& &link rel=&stylesheet& href=&/plugin/jquery-treeview/demo/screen.css& /& &
First: previous XML, MVC ActionForm and the Action is to be separated, and now with the annotation mode, it does not separate, with different annotations parameters can be distinguished. Such as: / ** * See access policy list * * @ Param type * O: se
Spring notes yesterday have a whole understanding, at least to complete a simple web application structure. Of course, not perfect, this is only the beginning! Today saw Spring 3.0 annotations, I feel that they have been subverted. Years ago, in orde
My example: up to save the data 1 front page, using spring tag [Note marked red] register.jsp &% @ Page language = &java& contentType = &text / charset = UTF-8& pageEncoding = &UTF-8&%& &% @ Taglib prefix = &qu
With the popularity of Annotation, some have joined the mainstream framework of support for Annotation. Annotation configuration uses a lot of work to simplify, to greatly improve the efficiency of program development. This will add the Sping MVC Spr
return String @ RequestMapping (params = &action = delete&) public String delete (@ RequestParam (&type&) int type, @ RequestParam (&url&) String url) { return &redirect: / console / visitorPolicyList.do? action = list &
Entity class Department package com.sj. import java.util.S import javax.persistence.CascadeT import javax.persistence.C import javax.persistence.E import javax.persistence.GeneratedV import javax.persistence.GenerationTyp
现在主流的Web MVC框架除了Struts这个主力 外,其次就是Spring MVC了,因此这也是作为一名程序员需要掌握的主流框架,框架选择多了,应对多变的需求和业务时,可实行的方案自然就多了.不过要想灵活运用Spring MVC来应对大多数的Web开发,就必须要掌握它的配置及原理 现在主流的Web MVC框架除了Struts这个主力 外,其次就是Spring MVC了,因此这也是作为一名程序员需要掌握的主流框架,框架选择多了,应对多变的需求和业务时,可实行的方案自然就多了.不过要想灵活运用S
1.@RequestMapping 用法 SpringMVC中,@RequestMapping用来处理请求,比如XXX.do @RequestMapping( & /aaa & ) // 类级别,可以不需要,如果要了,下面所有的请求路径前都需要加入/aaa public class ccccontroller{ @RequestMapping( & /bbb & ) // 方法级别,必须有,决定这个方法处理哪个请求,如果有类级别 /aaa/bbb public St
这个是本菜鸟自己遇到在难题,用了半天才解决,所以来分享一下. 目的是实现SpringMVC 和 ExtJs 能够通过Ajax 结合起来,也就是在Ext页面实现动态刷新. 主要是用来解决Ext的Ajax回调函数无响应的情况 本次举的例子是动态验证用户名是否重复 1.额外需要的Jar包 mysoa-0.9.4.jar slf4j-api-1.6.3.jar 2.ExtJS页面 JSP 编写 &%@ page language = &java& contentType = &
今天蛋疼了.项目需要,一个原先用struts2的项目要移到一个springmvc框架的项目上.之前以为很简单,原先的action换成controller,DAO换成service就行,没想到做的时候发现最大的难点是以前jsp都用的struts2标签写的.如果用springmvc的话我只会用ext在js里那种写法.根本不适合原先的jsp+jquery的用法.最闹听的是让我不用struts标签我就不会了啊. 好了吐槽完毕,捣鼓了一天,有了眉目,还没弄完,不过今天搞的信息量超大.停下来记录备忘下. 今
由于项目需要用到向导式的跳转页面效果,本项目又是用spring mvc实现的,刚开始想到用spring 的webflow,不过webflow太过笨重,对于我们不是很复杂的跳转来说好像有种&杀鸡焉用牛刀&的感觉,于是就网上搜索看有没有类似的解决方案,网上的答案一般都是叫你继承AbstractWizardFormContoller这个类来实现,但对于spring mvc3.0.x这个类将不再使用,转而推荐使用注解的方式来实现,于是参考官方文档,用注解方式实现了向导式页面. 下面是代码示例:
1:时间转换到前台页面 @Component public class JsonDateSerializer extends JsonSerializer { @Override public void serialize(Date date, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException { jsonGenerator
绑定模型对象中某个属性 Spring 2.0 定义了一个 org.springframework.ui.ModelMap 类,它作为通用的模型数据承载对象,传递数据供视图所用.我们可以在请求处理方法中声明一个 ModelMap 类型的入参,Spring 会将本次请求模型对象引用通过该入参传递进来,这样就可以在请求处理方法内部访问模型对象了.来看下面的例子: 使用 ModelMap 访问请示对应的隐含模型对象 @RequestMapping(params = &method=listBoardTo
1.弱口令漏洞,最好使用至少6位的数字.字母及特殊字符组合作为密码.数据库不要存储明文密码,应存储MD5加密后的密文,由于目前普通的MD5加密已经可以被破解,最好可以多重MD5加密. 2.未使用用户名及密码登录后台可直接输入后台URL登录系统. 解决方案:通过配置filter来过滤掉无效用户的连接请求. 3.JSP页面抛出的异常可能暴露程序信息.有经验的入侵者,可以从JSP程序的异常中获取很多信息,比如程序的部分架构.程序的物理路径.SQL注入爆出来的信息等. 解决方案:自定义一个Excepti
常用注解元素 @Controller 标注在Bean的类定义处 @RequestMapping 真正让Bean具备 Spring MVC Controller 功能的是 @RequestMapping 这个注解 @RequestMapping 可以标注在类定义处,将 Controller 和特定请求关联起来: 还可以标注在方法签名处,以便进一步对请求进行分流 配套的属性有: value 需要跳转的地址 method 基于RestFul的跳转参数,有RequestMethod.get post p
现在主流的Web MVC框架除了Struts这个主力外,其次就是Spring MVC了,因此这也是作为一名程序员需要掌握的主流框架,框架选择多了,应对多变的需求和业务时,可实行的方案自然就多了.不过要想灵活运用Spring MVC来应对大多数的Web开发,就必须要掌握它的配置及原理. 下面是Spring MVC 流程: 可以看到重点是DispatcherServlet. 看下逻辑结构: 其工作流程大致是: 1. 用户向服务器发送请求,请求被Spring 前端控制Servelt Dispatche
SpringMVC+Hibernate +MySql+ EasyUI实现CRUD(一) 大概的截图.很简单的小功能 注:使用的是MyEclipse 10.0 javaee 6.0 tomcat 6.0 导出指定列名.使用VO接受参数. SpringMVC+Hibernate +MySql+ EasyUI实现POI导出Excel(二) 和 批量删除数据 小功能的实现 1.datagrid新加的导出按钮代码 /*导出excel 按钮*/ toolbar:[{ id:'btnsave', text:'
开发指南专题七:JEECG微云快速开发平台 HQL过滤器 1. 查询HQL过滤器 1.1. 数据过滤现状分析 项目开发的查询页面都会有很多查询条件,开发追加查询条件的工作繁琐又很浪费时间. 这块工作量主要在:页面加查询字段和后台代码逻辑判断,追加查询条件: 目前JAVA持久层主流框架Hibernate和Ibatis实现方式分析: [1].Hibatente 技术实现: A.页面追加查询字段; B.后台代码需加逻辑判断,判断字段是否为空,手工拼SQL追加查询条件; [2].IBATIS 技术实现:
diamond-server运行跑起来之后,输入http://localhost:8080/diamond-server/ 账号和密码为abc/123,这个是程序user.properties配置文件写死的.所以说用户管理可以考虑迁移到数据库存储. 然后点击左侧的配置信息管理,右侧页面再点击添加配置信息 同理,可以去研究修改,删除其他操作的处理逻辑. ========================================================== 上传配置文件信息 这里需要注
一个类使用了@Controller进行标记的都是Controlle import javax.servlet.http.HttpServletR import org.springframework.stereotype.C import org.springframework.web.bind.annotation.RequestM import org.springframework.web.bind.
RequestMapping除了可以映射 特定 value返回值.请求method方法外,还可以对http请求的所有header进行映射. 这样看来,http请求的各个部分都可以进行请求的条件限定来完成 请求向物理视图的映射. value对应请求的url中的部分. method对应请求方法. 本文将介绍的是报文头的条件限定和get请求参数的限定. 控制器的get请求参数的限定和头的限定,如下代码的handle2和handle3方法: package com.happyBKs.springmvc.
The parameters are as follows @ RequestMapping /** * @see RequestMapping Parameters * @param value * The address you want to jump * @param mehtod * Jump parameters based on RestFul , RequestMethod.get post,put * @param params * In line with a paramet
原文标题[ Spring mvc中@Requestmapping再探] 1) 普通path路径 @RequestMapping(value = &/foos&) @ResponseBody public String getFoosBySimplePath() { return &Get some Foos&; } 然后尝试用curl请求下 curl -i http://localhost:8080/spring-mvc/foos 2) 指定RequestMetho
Spring MVC 解读--@RequestMapping 为了降低文章篇幅,使得文章更目标化,简洁化,我们就不例举各种@RequestMapping的用法等内容了. 文章主要说明以下问题: Spring怎样处理@RequestMapping(怎样将请求路径映射到控制器类或方法) Spring怎样将请求分派给正确的控制器类或方法 Spring如何实现灵活的控制器方法的 在Spring MVC 3.1 之前的版本中,Spring默认使用 DefaultAnnotationHandlerMappi
Spring MVC 解读--@RequestMapping 上一篇文章中我们了解了Spring如何处理@RequestMapping注解,并将请求映射信息保存到系统中以处理客户端发送来的请求,但是Spring是怎样接受请求,并根据请求URL来匹配正确的处理器方法呢,更重要的是Spring允许我们定义签名灵活的处理器方法,也就是说你的参数类型,顺序,返回类型都可以自定义,只要你方便就好.真的很棒,但是他怎样做到的呢? 这篇文章我们就研究这个问题. 一.重要的类和接口 HandlerMethodA
Servlet eroor: HTTP method GET is not supported by this URL Error: type: Status report message: HTTP method GET is not supported by this URL description: The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supp
Assume you have a params array with the following items: params[:qry][:name] = 'jo' params[:qry][:city] = & You would like to build a new URL with the current params appended. Should be as simple as: url_for (: action =& 'list',: params =& para
# Returns a string with a &tt& DIV &/ tt& containing all of the error messages for the objects located as instance variables by the names # Given. If more than one object is specified, the errors for the objects are displayed in the order that
Parameters: members of the class method parameters. Value parameter: can not change the actual parameter. No Keyword reference parameters: change arguments. ref Output parameters: for output parameters. out (If you have multiple return values, you ca
In normal circumstances, url can not directly transfer some special characters. If we want to pass, you can do the following treatment: Some symbols can not be directly in the URL is passed, if passed in the URL in these special symbols, then they wo
org.apache.struts2.views.util.UrlHelper buildUrl (String action, HttpServletRequest request, HttpServletResponse response, Map params)
Submitted to the code today, SVN Tip: Commit failed, error: MKCOL of'...': 405 Method Not Allowed, then svn up the code, then submit, the error still. SVN server and then view a bit and found the file the same name already exists, and the original co
ExecuteReader(string connectionString, CommandType commandType, string commandText, params SqlParameter[] commandParameters) Parameters params statement to note the number of parameters is optional, can be 0 or more. When more than one time to, &&quo
Today, write a file upload DEMO, but then when the upload task error is an error page: HTTP Status 405 - HTTP method POST is not supported by this URL I do not know where they have been wrong, I later discovered there are no servlet doPost method. Ac
Http request status: Status code status information Meaning 100 Continue The initial request has been accepted, the client should continue sending the rest of the request .(HTTP 1.1 New ) 101 Switching Protocols Server will comply with the requests o
Copyright (C) , All Rights Reserved.
版权所有 闽ICP备号
processed in 0.049 (s). 9 q(s)matplotlib基本使用方法示例 - JerryWisdom的博客 - CSDN博客
matplotlib基本使用方法示例
Deep Learning
这里是用jupyter notebook写的matplotlib的基本用法,使用的环境是python3+windows,代码上传到csdn资源啦:
关于matplotlib学习还是强烈建议常去官方里查一查各种用法和toturial等。&
下面是jupyter notebook代码导出的md文件。
Plotting and Visualization
from __future__ import division
from numpy.random import randn
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(12345)
plt.rc('figure', figsize=(10, 6))
from pandas import Series, DataFrame
import pandas as pd
np.set_printoptions(precision=4)12345678910
%matplotlib inline1
matplotlib API 介绍
import matplotlib.pyplot as plt1
Figures and Subplots
fig = plt.figure()1
ax1 = fig.add_subplot(2, 2, 1)1
ax2 = fig.add_subplot(2, 2, 2)
ax3 = fig.add_subplot(2, 2, 3)12
from numpy.random import randn
plt.plot(randn(50).cumsum(), 'k--')12
[&matplotlib.lines.Line2D at 0x28e7668cb38&]
_ = ax1.hist(randn(100), bins=20, color='k', alpha=0.3)
ax2.scatter(np.arange(30), np.arange(30) + 3 * randn(30))12
plt.close('all')1
fig, axes = plt.subplots(2, 3)
array([[&matplotlib.axes._subplots.AxesSubplot object at 0xBAFF98&,
&matplotlib.axes._subplots.AxesSubplot object at 0xC047F0&,
&matplotlib.axes._subplots.AxesSubplot object at 0xC4CB00&],
[&matplotlib.axes._subplots.AxesSubplot object at 0xC89D30&,
&matplotlib.axes._subplots.AxesSubplot object at 0xCD7940&,
&matplotlib.axes._subplots.AxesSubplot object at 0xD0FFD0&]], dtype=object)
## 调整subplot间距
plt.subplots_adjust(left=None, bottom=None, right=None, top=None,
wspace=None, hspace=None)12
fig, axes = plt.subplots(2, 2, sharex=True, sharey=True)
for i in range(2):
for j in range(2):
axes[i, j].hist(randn(500), bins=50, color='k', alpha=0.5)
plt.subplots_adjust(wspace=0, hspace=0)12345
fig, axes = plt.subplots(2, 2, sharex=True, sharey=True)
for i in range(2):
for j in range(2):
axes[i, j].hist(randn(500), bins=50, color='k', alpha=0.5)
plt.subplots_adjust(wspace=0, hspace=0)12345
### 线条格式
plt.figure()1
plt.plot(randn(30).cumsum(), 'ko--')1
[&matplotlib.lines.Line2D at 0x28e&]
plt.close('all')1
data = randn(30).cumsum()
plt.plot(data, 'k--', label='Default')
plt.plot(data, 'k-', drawstyle='steps-post', label='steps')
plt.legend(loc='best')1234
&matplotlib.legend.Legend at 0x28e&
### Ticks, labels, and legends #### Setting the title, axis labels, ticks, and ticklabels
fig = plt.figure(); ax = fig.add_subplot(1, 1, 1)
ax.plot(randn(1000).cumsum())
ticks = ax.set_xticks([0, 250, 500, 750, 1000])
labels = ax.set_xticklabels(['one', 'two', 'three', 'four', 'five'],
rotation=30, fontsize='small')
ax.set_title('some random lines')
ax.set_xlabel('Stages')12345678
&matplotlib.text.Text at 0x28e&
#### Adding legends
fig = plt.figure(); ax = fig.add_subplot(1, 1, 1)
ax.plot(randn(1000).cumsum(), 'k', label='one')
ax.plot(randn(1000).cumsum(), 'k--', label='two')
ax.plot(randn(1000).cumsum(), 'k.', label='three')
ax.legend(loc='best')123456
&matplotlib.legend.Legend at 0x28e&
### subplot 做标记
from datetime import datetime
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
data = pd.read_csv('julyedu/spx.csv', index_col=0, parse_dates=True)
spx = data['SPX']
spx.plot(ax=ax, style='k-')
crisis_data = [
(datetime(2007, 10, 11), 'Peak of bull market'),
(datetime(2008, 3, 12), 'Bear Stearns Fails'),
(datetime(2008, 9, 15), 'Lehman Bankruptcy')
for date, label in crisis_data:
ax.annotate(label, xy=(date, spx.asof(date) + 50),
xytext=(date, spx.asof(date) + 200),
arrowprops=dict(facecolor='black'),
horizontalalignment='left', verticalalignment='top')
ax.set_xlim(['1/1/2007', '1/1/2011'])
ax.set_ylim([600, 1800])
ax.set_title('Important dates in
financial crisis')123456789101112131415161718192021222324252627
&matplotlib.text.Text at 0x28e77fb7358&
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
rect = plt.Rectangle((0.2, 0.75), 0.4, 0.15, color='k', alpha=0.3)
circ = plt.Circle((0.7, 0.2), 0.15, color='b', alpha=0.3)
pgon = plt.Polygon([[0.15, 0.15], [0.35, 0.4], [0.2, 0.6]],
color='g', alpha=0.5)
ax.add_patch(rect)
ax.add_patch(circ)
ax.add_patch(pgon)1234567891011
&matplotlib.patches.Polygon at 0x28e77ed76a0&
### Saving plots to file
fig.savefig('figpath.svg')1
fig.savefig('figpath.png', dpi=400, bbox_inches='tight')1
from io import BytesIO
buffer = BytesIO()
plt.savefig(buffer)
plot_data = buffer.getvalue()1234
### matplotlib configuration
plt.rc('figure', figsize=(10, 10))1
## Plotting functions in pandas ### Line plots
plt.close('all')1
s = Series(np.random.randn(10).cumsum(), index=np.arange(0, 100, 10))
s.plot()12
&matplotlib.axes._subplots.AxesSubplot at 0x28e781c0208&
df = DataFrame(np.random.randn(10, 4).cumsum(0),
columns=['A', 'B', 'C', 'D'],
index=np.arange(0, 100, 10))
df.plot()1234
&matplotlib.axes._subplots.AxesSubplot at 0x28e&
### Bar plots
fig, axes = plt.subplots(2, 1)
data = Series(np.random.rand(16), index=list('abcdefghijklmnop'))
data.plot(kind='bar', ax=axes[0], color='k', alpha=0.7)
data.plot(kind='barh', ax=axes[1], color='k', alpha=0.7)1234
&matplotlib.axes._subplots.AxesSubplot at 0x11fd02b50&
df = DataFrame(np.random.rand(6, 4),
index=['one', 'two', 'three', 'four', 'five', 'six'],
columns=pd.Index(['A', 'B', 'C', 'D'], name='Genus'))
df.plot(kind='bar')12345
&matplotlib.axes._subplots.AxesSubplot at 0x28e77f482e8&
plt.figure()1
df.plot(kind='barh', stacked=True, alpha=0.5)1
&matplotlib.axes._subplots.AxesSubplot at 0x28e77e05be0&
tips = pd.read_csv('julyedu/tips.csv')
party_counts = pd.crosstab(tips.day, tips.size)
print(party_counts)
party_counts = party_counts.ix[:, 2:5]
print(party_counts)123456
col_0 1708 day Fri 19 Sat 87 Sun 76 Thur 62 Empty DataFrame Columns: [] Index: [Fri, Sat, Sun, Thur] ### Histograms and density plots
plt.figure()1
tips['tip_pct'] = tips['tip'] / tips['total_bill']
print(tips.head())
tips['tip_pct'].hist(bins=50)123
total_bill
sex smoker
&matplotlib.axes._subplots.AxesSubplot at 0x28e&
12345678910111213
plt.figure()1
tips['tip_pct'].plot(kind='kde')1
plt.figure()1
comp1 = np.random.normal(0, 1, size=200)
comp2 = np.random.normal(10, 2, size=200)
values = Series(np.concatenate([comp1, comp2]))
values.hist(bins=100, alpha=0.3, color='k', normed=True)
values.plot(kind='kde', style='k--')12345
&matplotlib.axes._subplots.AxesSubplot at 0x28e79b24358&
### Scatter plots
macro = pd.read_csv('julyedu/macrodata.csv')
data = macro[['cpi', 'm1', 'tbilrate', 'unemp']]
trans_data = np.log(data).diff().dropna()
trans_data[-5:]1234
plt.figure()1
plt.scatter(trans_data['m1'], trans_data['unemp'])
plt.title('Changes in log %s vs. log %s' % ('m1', 'unemp'))12
&matplotlib.text.Text at 0x28e7bfebcc0&
pd.scatter_matrix(trans_data, diagonal='kde', alpha=0.3)1
array([[&matplotlib.axes._subplots.AxesSubplot object at 0xCA07EF0&,
&matplotlib.axes._subplots.AxesSubplot object at 0xC6E9128&,
&matplotlib.axes._subplots.AxesSubplot object at 0xDFEEBA8&,
&matplotlib.axes._subplots.AxesSubplot object at 0xC3DB3C8&],
[&matplotlib.axes._subplots.AxesSubplot object at 0xC9E5EB8&,
&matplotlib.axes._subplots.AxesSubplot object at 0xC9D0E10&,
&matplotlib.axes._subplots.AxesSubplot object at 0xBFE87B8&,
&matplotlib.axes._subplots.AxesSubplot object at 0xC732FD0&],
[&matplotlib.axes._subplots.AxesSubplot object at 0xC9704E0&,
&matplotlib.axes._subplots.AxesSubplot object at 0xCF63320&,
&matplotlib.axes._subplots.AxesSubplot object at 0xC8BB748&,
&matplotlib.axes._subplots.AxesSubplot object at 0xC820978&],
[&matplotlib.axes._subplots.AxesSubplot object at 0xC6BBB00&,
&matplotlib.axes._subplots.AxesSubplot object at 0xC3405F8&,
&matplotlib.axes._subplots.AxesSubplot object at 0xC874DA0&,
&matplotlib.axes._subplots.AxesSubplot object at 0xE036550&]], dtype=object)
1234567891011121314151617
## Plotting Maps: Visualizing Haiti Earthquake Crisis data
data = pd.read_csv('julyedu/Haiti.csv')
data[['INCIDENT DATE', 'LATITUDE', 'LONGITUDE']][:10]1
INCIDENT DATE
-72.533333
114.174287
-72.334671
-72.310079
-73.638800
-73.195000
-72.236841
-72.410010
data['CATEGORY'][:6]1
0 1. Urgences | Emergency, 3. Public Health, 1 1. Urgences | Emergency, 2. Urgences logistiqu… 2 2. Urgences logistiques | Vital Lines, 8. Autr… 3 1. Urgences | Emergency, 4 1.
Urgences | Emergency, 5 5e. Communication lines down, Name: CATEGORY, dtype: object
data.describe()1
-72.322680
-74.452757
-72.417500
-72.335000
-72.293570
114.174287
data = data[(data.LATITUDE & 18) & (data.LATITUDE & 20) &
(data.LONGITUDE & -75) & (data.LONGITUDE & -70)
& data.CATEGORY.notnull()]123
def to_cat_list(catstr):
stripped = (x.strip() for x in catstr.split(','))
return [x for x in stripped if x]
def get_all_categories(cat_series):
cat_sets = (set(to_cat_list(x)) for x in cat_series)
return sorted(set.union(*cat_sets))
def get_english(cat):
code, names = cat.split('.')
if '|' in names:
names = names.split(' | ')[1]
return code, names.strip()12345678910111213
get_english('2. Urgences logistiques | Vital Lines')1
('2', 'Vital Lines')
all_cats = get_all_categories(data.CATEGORY)
english_mapping = dict(get_english(x) for x in all_cats)
english_mapping['2a']
english_mapping['6c']12345
'Earthquake and aftershocks'
def get_code(seq):
return [x.split('.')[0] for x in seq if x]
all_codes = get_code(all_cats)
code_index = pd.Index(np.unique(all_codes))
dummy_frame = DataFrame(np.zeros((len(data), len(code_index))),
index=data.index, columns=code_index)1234567
dummy_frame.ix[:, :6].info()1
&class 'pandas.core.frame.DataFrame'&
Int64Index: 3569 entries, 0 to 3592
Data columns (total 6 columns):
3569 non-null float64
3569 non-null float64
3569 non-null float64
3569 non-null float64
3569 non-null float64
3569 non-null float64
dtypes: float64(6)
memory usage: 195.2 KB
123456789101112
for row, cat in zip(data.index, data.CATEGORY):
codes = get_code(to_cat_list(cat))
dummy_frame.ix[row, codes] = 1
data = data.join(dummy_frame.add_prefix('category_'))12345
data.ix[:, 10:15].info()1
&class 'pandas.core.frame.DataFrame'&
Int64Index: 3569 entries, 0 to 3592
Data columns (total 5 columns):
category_1
3569 non-null float64
category_1a
3569 non-null float64
category_1b
3569 non-null float64
category_1c
3569 non-null float64
category_1d
3569 non-null float64
dtypes: float64(5)
memory usage: 167.3 KB
1234567891011
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
def basic_haiti_map(ax=None, lllat=17.25, urlat=20.25,
lllon=-75, urlon=-71):
m = Basemap(ax=ax, projection='stere',
lon_0=(urlon + lllon) / 2,
lat_0=(urlat + lllat) / 2,
llcrnrlat=lllat, urcrnrlat=urlat,
llcrnrlon=lllon, urcrnrlon=urlon,
resolution='f')
m.drawcoastlines()
m.drawstates()
m.drawcountries()
return m1234567891011121314151617
---------------------------------------------------------------------------
ImportError
Traceback (most recent call last)
&ipython-input-66-ec31ba3e955e& in &module&()
----& 1 from mpl_toolkits.basemap import Basemap
2 import matplotlib.pyplot as plt
4 def basic_haiti_map(ax=None, lllat=17.25, urlat=20.25,
lllon=-75, urlon=-71):
ImportError: No module named 'mpl_toolkits.basemap'
1234567891011121314
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(12, 10))
fig.subplots_adjust(hspace=0.05, wspace=0.05)
to_plot = ['2a', '1', '3c', '7a']
lllat=17.25; urlat=20.25; lllon=-75; urlon=-71
for code, ax in zip(to_plot, axes.flat):
m = basic_haiti_map(ax, lllat=lllat, urlat=urlat,
lllon=lllon, urlon=urlon)
cat_data = data[data['category_%s' % code] == 1]
x, y = m(cat_data.LONGITUDE.values, cat_data.LATITUDE.values)
m.plot(x, y, 'k.', alpha=0.5)
ax.set_title('%s: %s' % (code, english_mapping[code]))123456789101112131415161718
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(12, 10))
fig.subplots_adjust(hspace=0.05, wspace=0.05)
to_plot = ['2a', '1', '3c', '7a']
lllat=17.25; urlat=20.25; lllon=-75; urlon=-71
def make_plot():
for i, code in enumerate(to_plot):
cat_data = data[data['category_%s' % code] == 1]
lons, lats = cat_data.LONGITUDE, cat_data.LATITUDE
ax = axes.flat[i]
m = basic_haiti_map(ax, lllat=lllat, urlat=urlat,
lllon=lllon, urlon=urlon)
x, y = m(lons.values, lats.values)
m.plot(x, y, 'k.', alpha=0.5)
ax.set_title('%s: %s' % (code, english_mapping[code]))
1234567891011121314151617181920212223
make_plot()
相关文章推荐}

我要回帖

更多关于 eclipse mat 离线安装 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信