Posts

Showing posts from January, 2019

Matplotlib

Image
Introduction Matplotlib is the "grandfather" library of data visualization with Python. It was created by John Hunter. He created it to try to replicate MatLab's (another programming language) plotting capabilities in Python. So if you happen to be familiar with matlab, matplotlib will feel natural to you. It is an excellent 2D and 3D graphics library for generating scientific figures. Some of the major Pros of Matplotlib are: Generally easy to get started for simple plots Support for custom labels and texts Great control of every element in a figure High-quality output in many formats Very customizable in general Matplotlib allows you to create reproducible figures programmatically. Let's learn how to use it!Before continuing this lecture, I encourage you just to explore the official Matplotlib web page:  http://matplotlib.org/ Let's walk through a very simple example using two numpy arrays: Example Let...

Pandas

Image
Introduction to Pandas You can think of pandas as an extremely powerful version of Excel, with a lot more features. In this section of the course, you should go through the notebooks in this order: Introduction to Pandas Series DataFrames Missing Data GroupBy Merging,Joining,and Concatenating Operations Data Input and Output Series The first main data type we will learn about for pandas is the Series data type. Let's import Pandas and explore the Series object. A Series is very similar to a NumPy array (in fact it is built on top of the NumPy array object). What differentiates the NumPy array from a Series, is that a Series can have axis labels, meaning it can be indexed by a label, instead of just a number location. It also doesn't need to hold numeric data, it can hold any arbitrary Python Object. Let's explore this concept through some examples: Creating a Series You can convert a list,numpy array, or dictionary to a Series: ...