0% found this document useful (0 votes)
12 views1 page

Jupyter Notebook Data Acquisition Guide

This document outlines Exercise 1 for data acquisition using Jupyter Notebook, including setup instructions and problem statements. Participants are required to create a folder, download necessary files, and complete tasks involving data import and analysis from specified sources. The exercise emphasizes self-sufficiency while encouraging collaboration for assistance if needed.

Uploaded by

Wong Zhunhao
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Jupyter Notebook Data Acquisition Guide

This document outlines Exercise 1 for data acquisition using Jupyter Notebook, including setup instructions and problem statements. Participants are required to create a folder, download necessary files, and complete tasks involving data import and analysis from specified sources. The exercise emphasizes self-sufficiency while encouraging collaboration for assistance if needed.

Uploaded by

Wong Zhunhao
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Exercise 1: Data Acquisition

Setup
1. Create a folder on your Desktop and name it EE0005_[LabGroup], where [LabGroup] is the name of your Group.
2. Download the .ipynb files and data files posted corresponding to this exercise and store in the aforesaid folder.
3. Open Jupyter Notebook and navigate to the aforesaid folder on Desktop.
4. Open and explore the .ipynb files (notebooks) that you downloaded, and go through “Preparation”, as follows.
5. The walk-through videos posted on NTU Learn may help you with this “Preparation” too.
6. Create a new Jupyter Notebook, name it Exercise1_solution.ipynb, and save it in the same folder on the Desktop.
7. Solve the “Problems” posted below by writing code, and corresponding comments, in Exercise1_solution.ipynb
Note : Don’t forget to import the Essential Libraries required for solving the Exercise (check the preparation notebooks).

Preparation
M 1 [Link] Practice acquiring data in Jupyter notebook from various sources
You will need the data folder (posted as [Link]) to use this code
M 2 [Link] Check how to import the Pokemon data (Statistics not yet required)
You will need the CSV data file [Link] to use this code

Problems
Problem 1
Download the dataset from the following Kaggle Competition (login required) – Go to “Data”, and “Download All”.
House Prices Competition : [Link]
a) Import the “[Link]” data from the downloaded data folder (has four files) in Jupyter Notebook.
b) How many observations (rows) and variables (columns) are in the above dataset? Check the “shape”.
c) What are the data types (“dtypes”) – Numeric/Categorical – of the variables (columns) in the dataset?
d) What does the .info() method do? Use the .info() method on the imported dataset to check this out.
e) What does the .describe() method do? Use the .describe() method on the imported dataset to check.

Problem 2
Check Summer Olympic 2016 medal tally : [Link]
a) Import the Wikipedia page in Jupyter Notebook (check M1 [Link] for hints about this).
b) How many tables are in this Wikipedia page? Check the “len” of the imported page to find this out.
c) Which one is the actual “2016 Summer Olympics medal table”? Explore all tables in the data to know.
d) Store the main table, that is, “2016 Summer Olympics medal table”, as a new Pandas DataFrame.
e) Extract the TOP 20 countries from the medal table, and store these rows as a new DataFrame.

Important
Try to solve the problems on your own. Take help/hints from the “Preparation” codes and walk-through videos.
If you are still stuck, talk to your friends in the Lab to get help /hints. If that fails too, approach the Lab Instructor.

Page 1

Common questions

Powered by AI

The `.info()` method in Python's Pandas library provides a summary of a DataFrame, including the index dtype, column dtypes, non-null counts, and memory usage. This is significant in data analysis as it gives an overview of the dataset's structure, helps identify missing values, and ensures correct data types are being used for analysis .

To extract and manipulate data from a webpage like the 2016 Summer Olympics medal table in Jupyter Notebook, you first import the webpage using libraries such as Pandas with read_html() to parse HTML tables. Then, you check the length of tables using len() to identify how many tables have been imported. Explore each table to identify the correct medal table and store it as a Pandas DataFrame. Further manipulation involves selecting a subset of the data, for example, slicing the top 20 countries from the medal table into a new DataFrame .

The steps to set up a data acquisition environment using Jupyter Notebook include creating a folder on the Desktop named EE0005_[LabGroup], downloading the relevant .ipynb and data files into this folder, launching Jupyter Notebook and navigating to the folder, opening and exploring the preparation .ipynb files, creating a new notebook named Exercise1_solution.ipynb, and importing the essential libraries required for solving the exercise as referenced in the preparation notebooks .

To extract the TOP 20 countries from the 2016 Summer Olympics medal table as a new DataFrame using Python Pandas, first import and parse the table from the Wikipedia page. Store the relevant table into a DataFrame and sort it based on the total number of medals or another criteria. Then, use slicing or the head() function to select the top 20 rows, and assign this subset to a new DataFrame .

Discussing problems with peers and lab instructors is crucial because it fosters collaborative problem solving and allows for diverse perspectives on tackling issues. Peers and instructors might suggest alternative approaches or offer insights from their experience. This interaction can improve understanding, inspire new solutions, and enhance learning through communication and collaboration .

The data types of variables within a dataset can be identified using Python's Pandas library by inspecting the `.dtypes` attribute, which lists each column's type as numeric or categorical. This classification is important because different data types require different handling during analysis. Numeric data types allow for mathematical operations, while categorical data types are used for grouping and summarization .

Essential libraries greatly influence the functionality and capability of a Jupyter Notebook setup for data analysis as they provide necessary functions and methods to perform tasks efficiently. Libraries such as Pandas, NumPy, and Matplotlib facilitate data manipulation, statistical analysis, and visualization without the need for writing complex code from scratch. This enhances productivity, ensures code reliability, and supports exploration and visualization of data .

Preparation materials like walkthrough videos and example notebooks can aid in solving programming exercises by providing step-by-step guidance and demonstrations of similar tasks. They help in understanding the framework for implementation, offer insights into best practices, and reduce the learning curve by explaining complex tasks in a visual format. Example notebooks serve as reference points for setup, code structure, and potential pitfalls to avoid .

The `.describe()` method in Pandas provides summary statistics of the numeric columns in a DataFrame, including count, mean, standard deviation, min, and max values, and quartile (25%, 50%, 75%) values. It is typically used to perform an initial exploratory data analysis to understand the distribution and central tendencies of the data .

To determine the number of observations and variables in a dataset, the `.shape` method is used. In Jupyter Notebook, this is applied to the 'train.csv' data by first importing the dataset and then calling the `shape` property, which returns a tuple representing the dimensions of the dataset (number of rows and columns).

You might also like