Probability – Udacity

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 […]

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() […]

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: […]