chapter three

3 Python Crash Course

 

This chapter covers:

  • Core data types in Python including strings, integers, and floats
  • Built-in functions including len, str, float, and int
  • Defining custom functions with parameters and return values
  • The list, tuple, dictionary, and set data structures
  • Importing modules and packages into our program

The pandas library is built on top of the popular Python programming language, first released in 1991 by Dutch developer Guido van Rossum. A library, also called a package, is a toolbox of functionality that adds new features to a base language. Over 190,000 libraries are available to download on the Python Package Index (PyPi), a centralized online repository of Python codebases. These language extensions accelerate developer productivity by providing battle-tested solutions for common problems like database connections, web server upkeep, code quality, and even video game design. Pandas expands the core functionality of Python to support complex data structures that excel at storing and manipulating structured multi-dimensional data.

Python is classified as an object-oriented programming (OOP) language. An object can be described as a digital data structure that stores information and provides ways for that information to be accessed and manipulated. The OOP paradigm views a software program as a collection of objects that communicate with each other.

3.1      Simple Data Types

3.1.1   Numbers

3.1.2   Strings

3.1.3   Booleans

3.2      Operators

3.2.1   Mathematical Operators

3.2.2   Equality and Inequality Operators

3.3      Variables

3.4      Functions

3.4.1   Arguments and Return Values

3.4.2   Custom Functions

3.5      Objects and Methods

3.5.1   Attributes

3.5.2   Methods

3.5.3   Additional String Methods

3.6      Lists

3.6.1   Iteration

3.6.2   Lists and Strings

3.7      Tuples

3.8      Dictionaries

3.8.1   Dictionary Iteration

3.9      Sets

3.9.1   Set Operations

3.10  Modules, Classes, and Datetimes