Meta - Lesson 1

Last updated: October 13th, 20202020-10-13Project preview

This is the first lesson!Ā¶

This is a Jupyter Notebook, an interactive Python coding environment. What you'll see below is Python code that is dynamically computed. It's a simple addition, but just for demonstration purposes šŸ‘‡:

InĀ [1]:
2 + 2
Out[1]:
4
InĀ [1]:
from datetime import datetime

Days between 1st moon landing and beginning of year 2020:

InĀ [4]:
(datetime(2020, 1, 1) - datetime(1969, 7, 20)).days
Out[4]:
18427

For example, click on the tab that says "Terminal 1" to see an interactive linux terminal. We've hidden a text file with our contact info. Can you find it? šŸ˜‰

Batteries includedĀ¶

We've packed the most popular Python libraries in Namespace. requests, pandas, matplotlib, etc. Just import and start using them.

InĀ [1]:
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns

%matplotlib inline

Pokemon Time!Ā¶

pokemon_logo

To demonstrate the capabilities of Namespace and the integrated Jupyter environment, we'll do a quick analysis of Pokemon data. To do this, we're importing pandas, matplotlib and seaborn.

First, we'll read the CSV included in this lecture. Notice that it's a local dataset, it's included in our lecture.

InĀ [9]:
df = pd.read_csv('pokemon.csv', index_col=0)
InĀ [10]:
df.head()
Out[10]:
Name Type 1 Type 2 Total HP Attack Defense Sp. Atk Sp. Def Speed Stage Legendary
#
1 Bulbasaur Grass Poison 318 45 49 49 65 65 45 1 False
2 Ivysaur Grass Poison 405 60 62 63 80 80 60 2 False
3 Venusaur Grass Poison 525 80 82 83 100 100 80 3 False
4 Charmander Fire NaN 309 39 52 43 60 50 65 1 False
5 Charmeleon Fire NaN 405 58 64 58 80 65 80 2 False
InĀ [11]:
stats_df = df.drop(['Total', 'Stage', 'Legendary'], axis=1)
InĀ [12]:
sns.boxplot(data=stats_df)
Out[12]:
<AxesSubplot:>
InĀ [18]:
corr = stats_df.corr()
 
# Heatmap
sns.heatmap(corr)
Out[18]:
<AxesSubplot:>

Accessing other viewsĀ¶

Now try to use the Terminal view (click on the tab Terminal 1) to fetch the data under contact.txt and move to the next lesson!

Notebooks AI
Notebooks AI Profile20060