46 Simple Python Exercises This is version 0.45 of a collection of simple Python exercises constructed (but in many cases only found and collected) by Torbjörn Lager (firstname.lastname@example.org). Most of them involve characters, words and phrases, rather than numbers, and are therefore suitable for students interested in language rather than math. Very simple exercises Higher order functions and list comprehensions Hash function A hash function that maps names to integers from 0 to 15. There is a collision between keys "John Smith" and "Sandra Dee". Uses
Python for Fun This collection is a presentation of several small Python programs. They are aimed at intermediate programmers; people who have studied Python and are fairly comfortable with basic recursion and object oriented techniques. Each program is very short, never more than a couple of pages and accompanied with a write-up. I have found Python to be an excellent language to express algorithms clearly. Some of the ideas here originated in other programs in other languages. But in most cases I developed code from scratch from just an outline of an idea. Error Correcting Codes: Combinatorics, Algorithms and Applications Venkatesan Guruswami, Atri Rudra and Madhu Sudan If you have any comments, please email them to The plan is to put up a draft of the whole book sometime in 2015(?).
Scripting Languages: PHP, Perl, Python, Ruby - Hyperpolyglot a side-by-side reference sheet sheet one: version | grammar and execution | variables and expressions | arithmetic and logic | strings | regexes | dates and time | arrays | dictionaries | functions | execution control | exceptions | threads sheet two: streams | asynchronous events | files | file formats | directories | processes and environment | option parsing | libraries and namespaces | objects | inheritance and polymorphism | reflection | net and web | gui | databases | unit tests | logging | debugging sheet two: streams | asynchronous events | files | directories | processes and environment | option parsing | libraries and namespaces | objects | inheritance and polymorphism | reflection | net and web | gui | databases | unit tests | logging | debugging version used The versions used for testing code in the reference sheet.
A thorough guide to SQLite database operations in Python -- written by Sebastian Raschka on March 7, 2014 After I wrote the initial teaser article "SQLite - Working with large data sets in Python effectively" about how awesome SQLite databases are via sqlite3 in Python, I wanted to delve a little bit more into the SQLite syntax and provide you with some more hands-on examples. Sections • Connecting to an SQLite database • Creating a new SQLite database - Overview of SQLite data types - A quick word on PRIMARY KEYS: • Adding new columns • Inserting and updating rows • Creating unique indexes • Querying the database - Selecting rows • Security and injection attacks • Date and time operations • Printing a database summary • Conclusion
Principal Component Analysis 4 Dummies: Eigenvectors, Eigenvalues and Dimension Reduction Having been in the social sciences for a couple of weeks it seems like a large amount of quantitative analysis relies on Principal Component Analysis (PCA). This is usually referred to in tandem with eigenvalues, eigenvectors and lots of numbers. So what’s going on? Is this just mathematical jargon to get the non-maths scholars to stop asking questions? Maybe, but it’s also a useful tool to use when you have to look at data. This post will give a very broad overview of PCA, describing eigenvectors and eigenvalues (which you need to know about to understand it) and showing how you can reduce the dimensions of data using PCA.
BeginnersGuide/Programmers Please Note Because this is a Wiki page, users can edit it. You are therefore free to add details of material that other Python users will find useful. It is not an advertising page, and is here to serve the whole Python community. Users who continually edit pages to give their own materials (particularly commercial materials) prominence, or spam the listing with multiple entries which point to resources with only slightly altered material, may therefore find their accounts are disabled. The Nature of Code Hello! By browsing the table of contents on your left, you can read the entire text of this book online for free, licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License. Start reading the introduction now! If you like this book, please consider supporting it via the links below: Please submit corrections to the book on my Nature of Code GitHub repo.
30 free programming eBooks - citizen428.blog() Since this post got quite popular I decided to incorporate some of the excellent suggestions posted in the comments, so this list now has more than 50 books in it. BTW: I’m not very strict on the definition of “ebook”, some of them are really just HTML versions of books. [UPDATED: 2012-01-18] Learning a new programming language always is fun and there are many great books legally available for free online. Here’s a selection of 30 of them: Encrypted SQLite Databases with Python and SQLCipher SQLCipher, created by Zetetic, is an open-source library that provides transparent 256-bit AES encryption for your SQLite databases. SQLCipher is used by a large number of organizations, including Nasa, SalesForce, Xerox and more. The project is open-source and BSD licensed.
Introduction to Principal Component Analysis (PCA) - Laura Diane Hamilton Principal Component Analysis (PCA) is a dimensionality-reduction technique that is often used to transform a high-dimensional dataset into a smaller-dimensional subspace prior to running a machine learning algorithm on the data. When should you use PCA? It is often helpful to use a dimensionality-reduction technique such as PCA prior to performing machine learning because: Reducing the dimensionality of the dataset reduces the size of the space on which k-nearest-neighbors (kNN) must calculate distance, which improve the performance of kNN. Reducing the dimensionality of the dataset reduces the number of degrees of freedom of the hypothesis, which reduces the risk of overfitting. Most algorithms will run significantly faster if they have fewer dimensions they need to look at.