Python Data Analysis with Numpy, Pandas, and Matplotlib, Lecture notes of Data Structures and Algorithms

This document covers intermediate/advanced Python topics related to data analysis using Numpy, Pandas, and Matplotlib. It includes a review of basic data structures, accessing and working with objects in Python, and how to count letters in a column. The document also provides sample code and test operations to refine the data structure. useful for students studying data analysis and programming in Python.

Typology: Lecture notes

2021/2022

Uploaded on 05/11/2023

eklavya
eklavya 🇺🇸

4.5

(23)

266 documents

1 / 21

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Intermediate/Advanced
Python
Michael Weinstein
(Day 3)
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Python Data Analysis with Numpy, Pandas, and Matplotlib and more Lecture notes Data Structures and Algorithms in PDF only on Docsity!

Intermediate/Advanced

Python

Michael Weinstein

(Day 3)

Topics

› Review of basic data structures

› Accessing and working with objects in python

› Numpy

› Pandas

  • What are dataframes?
  • Sample column counting operation
  • Test, refine, test, refine, test, refine to get the data structure we want
  • Extracting a column

› Matplotlib

  • Making a simple line plot

› Scipy

How to think of a dataframe?

How to count letters in a column?

Data looks almost right, except we need it transposed (we want position to be the columns).

How to transpose

Looks good!

Testing out our next data structure

Testing out the data structure

This is what we want to see

Finalize the function and call

Pyplot marker codes (Don’t worry about memorizing) Keep a reference if you use these often character description '-' solid line style '--' dashed line style '-.' dash-dot line style ':' dotted line style '.' point marker ',' pixel marker 'o' circle marker 'v' triangle_down marker '^' triangle_up marker '<' triangle_left marker '>' triangle_right marker '1' tri_down marker '2' tri_up marker '3' tri_left marker '4' tri_right marker 's' square marker 'p' pentagon marker '*' star marker 'h' hexagon1 marker 'H' hexagon2 marker '+' plus marker 'x' x marker 'D' diamond marker 'd' thin_diamond marker '|' vline marker '_' hline marker

character color

‘b’ blue

‘g’ green

‘r’ red

‘c’ cyan

‘m’ magenta

‘y’ yellow

‘k’ black

‘w’ white

Iterative plotting… it’s really this simple