Python 201 by Michael Driscoll

By Michael Driscoll

Python 201 is the sequel to my first ebook, Python one hundred and one. if you happen to already recognize the fundamentals of Python and now you need to visit the subsequent point, then this is often the ebook for you! This booklet is for intermediate point Python programmers in basic terms. There will not be any newbie chapters right here. This e-book is predicated onPython three.

Show description

Read or Download Python 201 PDF

Best python books

Fundamentals of Python: From First Programs through Data Structures

In basics OF PYTHON: FROM FIRST courses via facts buildings, Washington and Lee collage professor Kenneth A. Lambert offers all the vital themes in CS1 and CS2 in a single quantity. This competitively priced layout offers teachers with a constant method of instructing introductory programming and information buildings over a regular two-term path series.

Python for Data Analysis: Data Wrangling with Pandas, NumPy, and IPython

Python for information research is anxious with the nuts and bolts of manipulating, processing, cleansing, and crunching info in Python. it's also a pragmatic, sleek creation to clinical computing in Python, adapted for data-intensive functions. it is a ebook concerning the elements of the Python language and libraries you'll have to successfully clear up a wide set of knowledge research difficulties.

Python and AWS

When you intend to take advantage of Amazon net companies (AWS) for distant computing and garage, Python is a perfect programming language for constructing functions and controlling your cloud-based infrastructure. This cookbook will get you began with greater than dozen recipes for utilizing Python with AWS, in line with the author’s boto library.

Artificial Intelligence with Python

Construct real-world synthetic Intelligence functions with Python to intelligently engage with the area round you approximately This publication Step into the superb international of clever apps utilizing this finished consultant input the realm of synthetic Intelligence, discover it, and create your individual purposes paintings via uncomplicated but insightful examples that might get you up and operating with man made Intelligence very quickly Who This booklet Is For This publication is for Python builders who are looking to construct real-world synthetic Intelligence functions.

Additional info for Python 201

Example text

You will note that we currently handle integers, strings and lists as the first 35 argument. If we were to call our add function with something else, such as a dictionary, then it would raise a NotImplementedError. Try running the code yourself. py", line 5, in add raise NotImplementedError('Unsupported type') NotImplementedError: Unsupported type As you can see, the code works exactly as advertised. It calls the appropriate function based on the first argument’s type. If the type isn’t handled, then we raise a NotImplementedError.

In this chapter, you learned some basic caching using lru_cache. Then we moved onto partials which lets you “freeze” a portion of your function’s arguments and/or keywords allowing you to create a new object that you can call. Next we used singledispatch to overload functions with Python. While it only allows function overloading based on the first argument, this is still a handy tool to add to your arsenal! Finally we looked at wraps which had a very narrow focus: namely it fixes docstrings and function names that have been decorated such that they don’t have the decorator’s docstring or name any more.

The functions inside functools are considered “higher-order” functions which can act on or return other functions. In this chapter we will be looking at the following portions of the functools package: • • • • lru_cache partials singledispatch wraps Let’s get started by learning how to create a simple cache with Python! lru_cache The functools module provides a handy decorator called lru_cache. 2. According to the documentation, it will “wrap a function with a memoizing callable that saves up to the maxsize most recent calls”.

Download PDF sample

Rated 4.17 of 5 – based on 7 votes