Probability Here you learned some fundamental rules of probability. Using notation, we could say that the outcome of a coin flip could either be T or H for the event that the coin flips tails or heads, respectively. Then the following rules are true: \bold{P(H)} = 0.5P(H)=0.5 \bold{1 – P(H) = P(\text{not H})} = 0.51−P(H)=P(not H)=0.5 where \bold{\text{not H}}not H is the event […]

# Category Archives: Udacity

## Project Notes – Udacity

b for new cell. x to delete cell.

m to markdown

## Data Analysis Process – Case Study 2 – Udacity

Drawing Conclusions

## Data Analysis Process – Case Study 1 – Udacity

import numpy as np

import pandas as pd

import matplotlib.pyplot as plt

% matplotlib inline

## Plotting with Pandas – Udacity

import pandas as pd % matplotlib inline df_census = pd.read_csv(‘census_income_data.csv’) df_census.info() df_census.hist(figsize=8, 8)); df_census[‘age’].hist() df_census[‘age’].plot(kind=’hist’); df_census[‘education’].value_counts() #aggregates counts for each unique value in a column df_census[‘education’].value_counts().plot(kind=’bar’) df_census[‘education’].value_counts().plot(kind=’pie’, figsize=(8, 8)); df_cancer = pd.read_csv(‘cancer_data_edited.csv’) pd.plotting.scatter_matrix(df_cancer, figsize=(15, 15)); df_cancer.plot(x=’compactness’, y=’concavity’, kind=’scatter’); df_cancer[‘concave_points’].plot(kind=’box’); import pandas as pd df = pd.read_csv(‘cancer_data_edited.csv’) df.head() df_m = df[df[‘diagnosis’] == ‘M’] df_m.head() […]

## Data Analysis Process – Udacity

Assessing and Building Intuition

Once you have your data loaded into dataframes, Pandas makes a quick investigation of the data really easy. Let’s explore some helpful methods for assessing and building intuition about a dataset. We can use the cancer data from before to help us.

## Introduction to the Python Standard Library – Udacity

Our favourite modules The Python Standard Library has a lot of modules! To help you get familiar with what’s available, here are a selection of our favourite Python Standard Library modules and why we use them! csv: very convenient for reading and writing csv files collections: useful extensions of the usual data types including OrderedDict, defaultdict and namedtuple random: […]

## Python 3 Syntax – Udacity

def readable_timedelta(days): “””Print the number of weeks and days in a number of days.””” #to get the number of weeks we use integer division weeks = days // 7 #to get the number of days that remain we use %, the modulus operator remainder = days % 7 return “{} week(s) and {} day(s)”.format(weeks, remainder)

## SQL Basics Recap – Udacity

You have already learned a lot about writing code in SQL! Let’s take a moment to recap all that we have covered before moving on: