Before we start
|
Python is an open source and platform independent programming language
SciPy ecosystem for Python provides the tools necessary for scientific computing
Jupyter Notebook and the Spyder IDE are great tools to code in and interact with Python with its large community it is easy to find help in the internet
|
Short Introduction to Programming in Python
|
Python is an interpreted language which can be used interactively (executing one command at a time) or in scripting mode (executing a series of commands saved in file).
One can assign a value to a variable in Python. Those variables can be of several types, such as string, integer, floating point and complex numbers.
Lists and tuples are similar in that they are ordered lists of elements; they differ in that a tuple is immutable (cannot be changed).
Dictionaries are unordered data structures that provide mappings between keys and values.
|
Starting With Data
|
|
Indexing, Slicing and Subsetting DataFrames in Python
|
In Python, portions of data can be accessed using indices, slices, column headings, and condition-based subsetting.
Python uses 0-based indexing, in which the first element in a list, tuple or any other data structure has an index of 0.
Pandas enables common data exploration steps such as data indexing, slicing and conditional subsetting.
|
Data Types and Formats
|
Pandas uses other names for data types than Python, for example: object for textual data.
A column in a DataFrame can only have one data type.
The data type in a DataFrame’s single column can be checked using dtype .
Make conscious decisions about how to manage missing data.
A DataFrame can be saved to a CSV file using the to_csv function.
|
Combining DataFrames with Pandas
|
|
Data Workflows and Automation
|
|
Making Plots With plotnine
|
The data , aes variables and a geometry are the main elements of a plotnine graph
With the + operator, additional scale_* , theme_* , xlab/ylab and facet_* elements are added
|
Data Ingest and Visualization - Matplotlib and Pandas
|
Matplotlib is the engine behind plotnine and Pandas plots.
Object-based nature of matplotlib plots enables their detailed customization after they have been created.
Export plots to a file using the savefig method.
|
Accessing SQLite Databases Using Python and Pandas
|
|