background preloader

Python Excel

Python Excel
Related:  Python

Python : lire et écrire des fichiers Microsoft Excel, application à Quantum GIS S'il y a une question récurrente sur les forums SIG, c'est comment traiter des données contenues dans des fichiers Microsoft Excel dans des SIGs comme Quantum GIS et autres (voir par exemple www.forumsig.org/showthread.php) Jusqu'à peu, les utilisateurs de Windows étaient favorisés car le module Pywin (qui utilise com) pouvait être utilisé pour cette tâche (voir « Python for Windows, Ressources and examples », par exemple). Rien pour les autres... Heureusement, deux modules « universels » sont sortis , xlrd pour lire les données et xlwt pour écrire des données (classeur, feuilles etc.). lecture d'un fichier Excel création d'un fichier Excel Principes Les modules sont basés sur la documentation d'OpenOffice sur le format des fichiers Microsoft Excel ( sc.openoffice.org/excelfileformat.pdf ) et sont écrits en pur Python, c'est-à-dire disponibles pour toutes les plateformes. Pour aller plus loin avec Quantum Gis couche Excel dans Quantum GIS

Creating Excel Files with Python and Django — Developer.com Introduction When a client needs to manipulate data, it's easiest to give them an Excel spreadsheet. Creating a spreadsheet is easy with Python, and making it available for web download is just as easy with the Django web framework. After a brief tangent into evolutionary history, you'll find out how to do both. Sharks haven't evolved much in millions of years, mostly because they're wildly efficient. Much like sharks, spreadsheets haven't evolved much in the past few decades. Given the efficiency of spreadsheets, sometimes it pays to acknowledge their power, and not waste your time trying to improve on it. It's rare to find a client that knows exactly how they want to manipulate the data you're going to be presenting to them. This isn't some flaw in a product owner's mind; rather, it's a direct result of their probably never having actually seen all the data in one place before. Given the above, whenever possible, I like to give a product owner an Excel representation of their data.

How to extract data from Excel into NumPy The Python Standard Library — Python v3.4.0b2 documentation While The Python Language Reference describes the exact syntax and semantics of the Python language, this library reference manual describes the standard library that is distributed with Python. It also describes some of the optional components that are commonly included in Python distributions. Python’s standard library is very extensive, offering a wide range of facilities as indicated by the long table of contents listed below. The library contains built-in modules (written in C) that provide access to system functionality such as file I/O that would otherwise be inaccessible to Python programmers, as well as modules written in Python that provide standardized solutions for many problems that occur in everyday programming. Some of these modules are explicitly designed to encourage and enhance the portability of Python programs by abstracting away platform-specifics into platform-neutral APIs.

Batterii/webobtoolkit Sauvegarde de données avec Python et le module csv CSV, ou Comma-separated values , est un format informatique ouvert représentant des données tabulaires sous forme de valeurs séparées par des virgules. (Définition de Wikipédia). Séparé par des virgules, ou tout autre caractère choisis d’avance en pratique, avec Python . Ce format à l’avantage de stocker des données simplement, sans forcément avoir recours à une base de données tel que sqlite3 par exemple. Les données étant stocké en texte clair, elles sont récupérable par tout autre scripts et langages, par exemple pour générer des graphiques après. Python offre un module de base simple pour faire cela. Stocker des tableaux import csv #Un tableau: prénom, âge data = [ [ 'paul' , 42 ] , [ 'nico' , 31 ] , [ 'jack' , 22 ] #On écrit dans le fichier with open ( 'test.csv' , 'w' ) as f: writer = csv . writer ( f ) writer. writerows ( data ) #On lit dans le fichier with open ( 'test.csv' , 'r' ) as f: reader = csv . reader ( f ) for i in reader: print i $ . [ 'paul' , '42' ] [ 'nico' , '31' ] [ 'jack' , '22' ]

Download excel based mutualfund portfolio tracker - create your own - how to | Pointy Haired Dilbert - Chandoo.org Posted on April 18th, 2008 in Featured , ideas , Learn Excel , personal finance , technology - 132 comments Would you like to spend next 5 minutes learning how to create an excel sheet to track your mutual fund portfolio? Download the mutual fund portfolio tracker excel workbook now. [Download Excel 2003 compatible version here] NOTE: File updated on 7-FEB-2012 to fix errors. We will use 2 simple excel features to achieve this – web queries and vlookup() [click here to learn more about web queries in excel] First, lets put a tabular format for our portfolio: We can have fund name, # of units, purchase NAV (Net Asset Value, the cost of unit for your when you bought it), purchase date, total value at purchase (units * purchase NAV), current NAV (we will pull this data from internet), value as of now (units * current NAV), Profit / loss amount and profit / loss % as our table columns. You can do the same for stock portfolios, commodities etc. Few ideas on how you can enhance this:

run a basic digital clock in the python shell

Related: