
This notebook is part of the IPython NB Example; the content is available on GitHub.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
< IPynb Example 1 | Contents | IPynb Example 3 >
IPynb Example 2¶
Purpose: The purpose of this workbook is to help you get comfortable with the topics below.
Recomended Usage
- Run each of the cells (Shift+Enter) and edit them as necessary to solidify your understanding
- Do any of the exercises that are relevant to helping you understand the material
Topics Covered
- Test Display Pandas
- Test Display Seaborn
Introduction¶
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
import pandas as pd
import numpy as np # just to show pandas compatability with np
import seaborn as sns # just for getting some sample datasets
Test Display Pandas¶
# Series with cusom indicies
s4 = pd.Series([0, 1, 2, 3], index=['a', 'b', 'c', 'd'])
s4
# Series from a dictionary
dict = {'a': 0,
'b': [1, 2, 3],
'c': 2}
s5 = pd.Series(dict)
s5
# DataFrame from Python list
df1 = pd.DataFrame([0, 10, 20, 30, 40])
df1
# Dataframe with different types and lengths
df2 = pd.DataFrame([3, ['a', 'b', 'c']])
df2
# Explicitly name the columns
data = [['a', 12], ['b', 20], ['c', 40], ['d', 33], ['e', 88]]
df3 = pd.DataFrame(data, columns=['letters', 'numbers'], dtype=float)
df3
Test Display Seaborn¶
diamonds_df = sns.load_dataset('diamonds')
# Checkout the beginning of the data
diamonds_df.head()
# Checkout the end of the data
diamonds_df.tail()
sns.catplot(x="color", y="price", kind="boxen",
data=diamonds_df.sort_values("color"));