Dive into Python

Introduction to Data Science in Python

Hillary Green-Lerman

Lead Data Scientist, Looker

What you'll learn

  • How to write and execute Python code with DataCamp
  • How to load data from a spreadsheet
  • How to turn data into beautiful plots
Introduction to Data Science in Python

Solving a mystery with data

bayes

ransom-note

Introduction to Data Science in Python

Using the IPython shell

console.gif

Introduction to Data Science in Python

Using the script editor

script.gif

Introduction to Data Science in Python

What is a module?

  • Groups related tools together
  • Makes it easy to know where to look for a particular tool
  • Common examples:
    • matplotlib
    • pandas
    • scikit-learn
    • scipy
    • nltk
Introduction to Data Science in Python

Importing pandas and matplotlib

import pandas as pd
from matplotlib import pyplot as plt
# Pandas loads our data
df = pd.read_csv('ransom.csv')

# Matplotlib plots and displays
plt.plot(df.letters, df.frequency)
plt.show()

simple-plot

Introduction to Data Science in Python

Importing a module

  • Importing a Module

    import pandas
    
  • Importing a module with an alias

    import pandas as pd
    
Introduction to Data Science in Python

Let's practice!

Introduction to Data Science in Python

Preparing Video For Download...