1. Introduction to Jupyter Notebooks
Activity 1.01: Using Jupyter to Learn about pandas DataFrames
Solution:
- Start one of the following platforms to run Jupyter Notebooks:
Jupyter Notebook (run
jupyter notebook
)JupyterLab (run
jupyter lab
)Then, open the platform in your web browser by copying and pasting the URL, as prompted in the Terminal.
- Load the
numpy
library as follows:import numpy as np
- Import
pandas
, as follows:import pandas as pd
- Pull up the docstring for the pandas DataFrame object, as follows:
pd.DataFrame?
The output is as follows:
- Use a dictionary to create a DataFrame with
fruit
andscore
columns, as follows:fruit_scores = {'fruit': ['apple', 'orange', \ 'banana', 'blueberry'], \ ...