This is not the document you are looking for? Use the search form below to find more!

Report home > Others

Plotting data with python and pylab

0.00 (0 votes)
Document Description
Plotting data with python and pylab
File Details
  • Added: April, 14th 2011
  • Reads: 402
  • Downloads: 8
  • File size: 971.01kb
  • Pages: 24
  • Tags: csv, plotting, matplotlib, plot, pylab, numpy, python, scipy, graphing
  • content preview
Submitter
  • Name: hubert

We are unable to create an online viewer for this document. Please download the document instead.

Plotting data with python and pylab screenshot

Add New Comment




Related Documents

RabbitMQ with python and ruby RuPy 2009

by: qadir, 87 pages

RabbitMQ with python and ruby RuPy 2009

Self-Service Linked Government Data with dcat and Gridworks

by: rosie, 24 pages

Self-Service Linked Government Data with dcat and GridworksFadiMaali, Richard Cyganiak, VassiliosPeristerasTriplification Challenge 2010 at I-Semantics, GrazRaw ...

How to make money with Kindle and Amazon.

by: constin, 2 pages

How to make money with Kindle and Amazon. FORCE Amazon To Hand You #1 Bestseller Status In 48 Hours Or Less... Guaranteed!

7 Tips on How to Make Money With Google and AdSense

by: constin, 2 pages

How to make money with Google and Adsense. Increase Your AdSense CPC Earnings to a CRAZY 400% In JUST 30 Minutes! Adsense Insider Secret.

Operations with Integers and Rational Numbers

by: nishagoyal, 3 pages

If we look at any integer say -7, we find that -7 can be written as -7 /1, where -7 and 1 both are integers and the denominator 1 < > 0. So -7 is absolutely expressed in form of a rational number. ...

5 TIPS ON HOW TO SAVE MONEY WITH PRINTERS AND COPIERS

by: Printer, 1 pages

If you have a printer or copier you'll know what the expenses are, but you might need help to work out how to streamline your costs.

Interpolation with SciPy and NumPy

by: aldous, 20 pages

Interpolation with SciPy and NumPy

MongoDB + Pylons FTW: Scalable Web apps with Python & NoSQL

by: anna, 15 pages

MongoDB + Pylons FTW: Scalabale Web apps with Python & NoSQL Niall O'Higgins MongoDB ?? Non-relational (NoSQL) document-oriented database ...

Easy integration of geospatial data with the open source spatial ETL tool GeoKettle

by: mersada, 18 pages

Easy integration of geospatial  data with the open source  spatial ETL tool GeoKettle 1st  Rendez­vous OSGeo­Quebec Dr. Thierry Badard, CTO Spatialytics inc. ...

Content Preview
Barcelona Python MeetupPlotting data with python and pylabGiovanni M. Dall'Olio Problem statement Let's say we have a table of data like this: namecountryapplespearsGiovanniItaly3113MarioItaly2333LuigiItaly05MargaretEngland2213AlbertGermany156How to read it in python?How to do some basic plotting? Alternatives for plotting data in pythonPylab (enthought)  → Matlab/Octave approachEnthought   e→ xtended version of Pylab (free for academic use)rpy/rpy2   → allows to run R commands within pythonSage → interfaces python with Matlab, R, octave, mathematica, ... The Pylab systempylab is a system of three libraries, which together transform python in a Matlab­like environmentIt is composed by:Numpy (arrays, matrices, complex numbers, etc.. in python)Scipy (extended scientific/statistics functions)Matplotlib (plotting library)iPython (extended interactive interpreter) How to install pylabThere are many alternatives to install PyLab:use the package manager of your linux distro use enthought's distribution (http://www.enthought.com/products/epd.php) (free for academic use)compile and google for help!Numpy and scipy contains some Fortran libraries, therefore easy_install doesn't work well with them ipython -pylabIpython is an extended version of the standard python interpreterIt has a modality especially designed for pylabThe standard python interpreter doesn't support very well plotting (not multi­threading)So if you want an interactive interpreter, use ipython with the pylab option:     $: alias pylab=”ipython -pylab” $: pylab In [1]: Why the python interpreter is not the best for plotting Gets blocked when you create a plotHow to read a CSV file with pythonTo read a file like this in pylab:namecountryapplespearsGiovanniItaly3113MarioItaly2333LuigiItaly05MargaretEngland2213AlbertGermany156 → Use the function 'matplotlib.mlab.csv2rec'>>> data = csv2rec('exampledata.txt', delimiter='\t') Numpy - record arrayscsv2rec stores data in a numpy recarray object, where you can access columns and rows easily: >>> print data['name'] ['Giovanni' 'Mario' 'Luigi' 'Margaret' 'Albert'] >>> data['apples'] array([31, 23, 0, 22, 15]) >>> data[1] ('Mario', 'Italy', 23, 33) Alternative to csv2recnumpy.genfromtxt (new in 2009)More options than csv2rec, included in numpyTricky default parameters: need to specify dtype=None >>> data = numpy.genfromtxt('datafile.txt', dtype=None) >>> data array.... Document Outline
  • ÿ
  • ÿ
  • ÿ
  • ÿ
  • ÿ
  • ÿ
  • ÿ
  • ÿ
  • ÿ
  • ÿ
  • ÿ
  • ÿ

Download
Plotting data with python and pylab

 

 

Your download will begin in a moment.
If it doesn't, click here to try again.

Share Plotting data with python and pylab to:

Insert your wordpress URL:

example:

http://myblog.wordpress.com/
or
http://myblog.com/

Share Plotting data with python and pylab as:

From:

To:

Share Plotting data with python and pylab.

Enter two words as shown below. If you cannot read the words, click the refresh icon.

loading

Share Plotting data with python and pylab as:

Copy html code above and paste to your web page.

loading