background preloader

Python

Facebook Twitter

Quantitative Economics — quant-econ 1 documentation. How IPython Notebook and Github have changed the way I teach Python. A live notebook about how to use lists in Python.

How IPython Notebook and Github have changed the way I teach Python

I teach in a small high school in southeast Alaska, and each year I teach an Introduction to Programming class. I recently learned how to use IPython Notebook, and it has completely changed the way I teach my classes. There is much to improve about CS education at the K-12 level in the United States, and sharing our stories and our resources will go a long way towards improving what we offer to students.

My first programming classes How I tend to use Python: A model of a koch snowflake, and the real thing printed in stainless steel. Like many people who teach Intro to Programming classes, I don’t have a formal CS degree. The first time I taught an introductory programming class, I created lessons each day and came up with exercises and challenges for students to try. The second time around, I tried to base the class on an established curriculum.

This year’s class. IPython in Excel. The Python programming language offers a great choice of tools and libraries for all sorts of mathematical and scientific use cases.

IPython in Excel

Yet the out of the box command line interface leaves a lot to be desired, in particular on Windows - there's no syntax coloring, no autocomplete [1] nor input history. Fortunately, there's the IPython project - an extraordinary attempt by the open source community [2] to add these features and provide a truly interactive Python interpreter. After 10 years of development, a stable, 1.0 version of IPython has lately been released. I am proud to announce that, as of today, DataNitro fully integrates the IPython shell with Excel on Windows. In this post I'm going to describe the installation process of IPython and demonstrate its most valuable features - all in Excel!

Installation Setting up Python and its libraries on Windows is not always a straightforward process - see our previous blog post for an introduction. Coloring and Indenting. Of solving the rubik's from scratch [Python] Internet is full of solution for the rubik’s cube.

Of solving the rubik's from scratch [Python]

However, it is seldom described how these solutions were discovered. In this post I’ll try to detail how one can solve the rubik’s cube from scratch. Disclaimer : The solution presented here is by no mean the fastest… It is actually very long to solve the Rubix Cube using this algorithm. Canopy Subscriptions. First impressions of the IPython Notebook. July 2013 I've been using the IPython Notebook for less than a week, and I can already tell that there's no way I'm going back to my former data analysis workflow.

First impressions of the IPython Notebook

Here are my first impressions. My former workflow Before discovering the IPython Notebook, I analyzed data with Python for many years using the following workflow. I first create a new directory for each experiment and then enter the following loop: Four Tricks for Comprehensions in Python. Quantitative Economics — quant-econ 1 documentation. Probabalistic Scraping of Plain Text Tables. Recently I have been banging my head trying to import a ton of OCR acquired data expressed in tabular form.

Probabalistic Scraping of Plain Text Tables

I think I have come up with a neat approach using probabilistic reasoning combined with mixed integer programming. The method is pretty robust to all sorts of real world issues. In particular, the method leverages topological understanding of tables, encodes it declaratively into a mixed integer/linear program, and integrates weak probabilistic signals to classify the whole table in one go (at sub second speeds). This method can be used for any kind of classification where you have strong logical constraints but noisy data. Plain text tables are quite interesting when encountered in the wild. These tables have: differing spatial layout of header fields (e.g. The important thing in a table is that values and declaration tokens have to match types, and be consistent over an entire column. We force one of the variables to be one by adding a linear constraint,

The Hitchhiker’s Guide to Python! Greetings, Earthling!

The Hitchhiker’s Guide to Python!

Welcome to The Hitchhiker’s Guide to Python. This is a living, breathing guide. If you’d like to contribute, fork us on GitHub! This handcrafted guide exists to provide both novice and expert Python developers a best practice handbook to the installation, configuration, and usage of Python on a daily basis. This guide is opinionated in a way that is almost, but not quite, entirely unlike Python’s official documentation.

Let’s get started! Learn Data Science by nborwankar. Who Nitin Borwankar - primary developer (Sponsored by Pivotal Inc. and Alpine Data Labs).

Learn Data Science by nborwankar

What A collection of Data Science Learning materials in the form of IPython Notebooks.Associated data sets. The initial beta release consists of four major topics Linear RegressionLogistic RegressionRandom ForestsK-Means Clustering Each of the above has at least three IPython Notebooks covering Overview (an exposition of the technique for the math-wary)Data Exploration (the nuts and bolts of real world data wrangling)Analysis (using the technique to get results)

Nbviewer.ipython.org/urls/raw.github.com/sanand0/ipython-notebooks/master/Office.ipynb. Understanding the FFT Algorithm. The Fast Fourier Transform (FFT) is one of the most important algorithms in signal processing and data analysis.

Understanding the FFT Algorithm

I've used it for years, but having no formal computer science background, It occurred to me this week that I've never thought to ask how the FFT computes the discrete Fourier transform so quickly. I dusted off an old algorithms book and looked into it, and enjoyed reading about the deceptively simple computational trick that JW Cooley and John Tukey outlined in their classic 1965 paper introducing the subject. CliTableHowTo - textfsm - How to use the CliTable class. - Python module for parsing semi-structured text into python tables.