background preloader

Python

Facebook Twitter

  Google Developers. Welcome to Google's Python Class -- this is a free class for people with a little bit of programming experience who want to learn Python.

  Google Developers

The class includes written materials, lecture videos, and lots of code exercises to practice Python coding. These materials are used within Google to introduce Python to people who have just a little programming experience. The first exercises work on basic Python concepts like strings and lists, building up to the later exercises which are full programs dealing with text files, processes, and http connections. The class is geared for people who have a little bit of programming experience in some language, enough to know what a "variable" or "if statement" is. Beyond that, you do not need to be an expert programmer to use this material. This material was created by Nick Parlante working in the engEDU group at Google. Tip: Check out the Python Google Code University Forum to ask and answer questions. Jupyter Notebook Viewer. Pandas Pivot Table Explained - Practical Business Python. Introduction Most people likely have experience with pivot tables in Excel.

Pandas Pivot Table Explained - Practical Business Python

Pandas provides a similar function called (appropriately enough) pivot_table . While it is exceedingly useful, I frequently find myself struggling to remember how to use the syntax to format the output for my needs. This article will focus on explaining the pandas pivot_table function and how to use it for your data analysis. If you are not familiar with the concept, wikipedia explains it in high level terms. As an added bonus, I’ve created a simple cheat sheet that summarizes the pivot_table. The Data One of the challenges with using the panda’s pivot_table is making sure you understand your data and what questions you are trying to answer with the pivot table.

In this scenario, I’m going to be tracking a sales pipeline (also called funnel). Typical questions include: Beautiful Soup Documentation — Beautiful Soup 4.2.0 documentation. Beautiful Soup is a Python library for pulling data out of HTML and XML files.

Beautiful Soup Documentation — Beautiful Soup 4.2.0 documentation

It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work. These instructions illustrate all major features of Beautiful Soup 4, with examples. I show you what the library is good for, how it works, how to use it, how to make it do what you want, and what to do when it violates your expectations. The examples in this documentation should work the same way in Python 2.7 and Python 3.2. You might be looking for the documentation for Beautiful Soup 3. This documentation has been translated into other languages by Beautiful Soup users: 这篇文档当然还有中文版.このページは日本語で利用できます(外部リンク)이 문서는 한국어 번역도 가능합니다.

Here’s an HTML document I’ll be using as an example throughout this document. Here are some simple ways to navigate that data structure: One common task is extracting all the URLs found within a page’s <a> tags: Tag Name. DataScienceSpecialization/courses. 10-minute tour of pandas. Python Lists - Google for Education. Python has a great built-in list type named "list".

Python Lists - Google for Education

List literals are written within square brackets [ ]. Lists work similarly to strings -- use the len() function and square brackets [ ] to access data, with the first element at index 0. (See the official python.org list docs.) Assignment with an = on lists does not make a copy. Instead, assignment makes the two variables point to the one list in memory. The "empty list" is just an empty pair of brackets [ ]. Python's *for* and *in* constructs are extremely useful, and the first use of them we'll see is with lists. If you know what sort of thing is in the list, use a variable name in the loop that captures that information such as "num", or "name", or "url". The *in* construct on its own is an easy way to test if an element appears in a list (or other collection) -- value in collection -- tests if the value is in the collection, returning True/False.

You can also use for/in to work on a string. Here are some other common list methods. Python Boot Camp. The BootCamp has wrapped up ... if you took the bootcamp please give us feedback.

Python Boot Camp

We took over all the Brower Center! This is the main site for the Python Boot Camp Fall 2013, at the Brower Center (2150 Allston Way) near the UC Berkeley Campus from August 26 (Monday) to August 28 (Wednesday) 2013. The purpose of the boot camp is to get those familiar with other computing languages (like C, Java, FORTRAN, and Lisp) ramped on the basics of the Python language. This is not a computer science class; understanding of basic CS concepts (like looping, recursion, pointers, etc.) are presupposed. The Boot Camp itself is a mixture of formal lectures, in-class demos, coding breakout sessions for participants, and homework projects. If you are interested in a detailed introduction to various Pythonic topics to aid in research, consider the "Python Computing for Data Scientists" seminar course (Thursday 1-4pm; Fall 2013, CC #06080).