You are on page 1of 31

PEN: -200840131505

Practical 3

Aim: - Setting up Python for Data Science


PEN: -200840131505

Practical 3.1

Aim: - Installing Anaconda on Windows.

Step 1: -Click on the link below to open the download page.

https://www.anaconda.com/download/#windows
PEN: -200840131505

Step 2: - Double click the installer to launch.

Step 3: - Click on Next.


PEN: -200840131505

Step 4: - Read the license agreement and click on “I Agree”.

Step 5: - Select installation type “Just Me” unless you’re installing it for allusers (which
require Windows Administrator privileges) and clickon Next.
PEN: -200840131505

Step 6: -Select a destination folder to install Anaconda and click the “Next” button.

Step 7: - Click the Install button.


PEN: -200840131505

Step 8: -Click on the Next button.

Step 9: -And then click the Finish button.


PAN:-200840131505

Practical:-3.2
Aim:- Working with Jupyter Notebook.
Step 1:- Clicking on the Jupyter Notebook App in the Start Menu .

Step 2:- jupyter notebook terminal and connected to it’s server.


PAN:-200840131505

Step 3:- You will know that Jupyter Notebook opened correctly if you see a page similar to this
one open in your browser.

Step 4:- Navigate through your folders until you get to the directory you want to save your
scripts in.
PAN:-200840131505

Step 5:- . You can navigate through by clicking on the name of the Folder.

Step 6:-You can rename directory name.


PAN:-200840131505

 Created directory:-

Step 7:- Open a new Notebook file by clicking on the “New” menu on the upper right.
PAN:-200840131505

Step 8:- Open a previously saved Notebook file by clicking on the name of the file.
• The extension for a Jupyter Notebook file is “.ipynb”, which is short for “interactive
python notebook”.

Step 9:- A new Notebook looks like this:


First, click on “Untitled” to name your script.
PAN:-200840131505

Step 10:- It’s good practice to start your script by importing libraries you will need.
 If there is a number here, then the cell has been evaluated! This means that the code
written in that cell has been run. A cell is evaluated by either clicking “Run” or by typing
Shift+Return.
PAN:-200840131505

Using Google Drive:-

Step 1:- Open Google Drive.

Step 2:- Click “New” and go “More” option and go”Connect to other app”.
PAN:-200840131505

Step 3:- Search “Colaboratory”.

Step 4:-Install Colaboratory.


PAN:-200840131505

Step5:-Sign up .

Step 6:-
PAN:-200840131505

Step 7:-Open colaboratory.

Step 8:-open Colaboratory notebook.


PAN:-200840131505

Step 9:-Notebook Setting.

Step10:-you can also share with your friends.


PAN:-200840131505

Step 11:- Create notebook.

Step 12:-Notebook save in google drive.


PAN:-200840131505
PAN:-200840131505

Step 13:-Google drive save file.


PAN:-200840131505

Using GitHub to save notebooks:-


 You initially need to provide the location of the source code online. The location must point to a
public project; you can't use Collab to access private projects.
PAN:-200840131505
PAN:-200840131505
PAN:-200840131505

Practical:-3.3
Aim:- Performing Common Tasks.
 Creating code cells
o A new cell can be created by clicking on ‘+’ sign or you can also create from the click on
insert menu.
o Whenever you create a new cell in the jupyter notebook then by default it was a code cell.
PAN:-200840131505

 Creating text cells


o Text cells allow you to write and render Markdown syntax. This is where you can
describe and document your workflow.
o For creating text cell you have to change cell type to the markdown.
PAN:-200840131505

 Creating special cells executing code:

o Raw NBCovert type of cells used for the special purpose.it will be converted in a way
specific to output such has HTML
PAN:-200840131505

 Viewing Your Notebook


o Open jupyter notebook dashboard click on the file that you want to view.
PAN:-200840131505

Practical:-3.4
Aim:- Understanding the following datasets with its code.

This book uses a number of datasets, all of which appear in the Scikit-learn
library. These dataset demonstrate various ways in which you can interact with
data, and you use them in the examples to perform a variety of tasks. The
following list provides a quick overview of the function used to import each of
the datasets into your Python code:

• load_boston(): Regression analysis with the Boston house-prices


dataset
Load and return the boston house-prices dataset (regression).
PAN:-200840131505

 load_iris(): Classification with the Iris dataset

• load_diabetes(): Regression with the diabetes dataset

Load and return the diabetes dataset (regression).


PAN:-200840131505

• load_digits([n_class]): Classification with the digits dataset

Load and return the digits dataset (classification).

Each datapoint is a 8x8 image of a digit.

 fetch_olivetti_faces(): Olivetti faces dataset from AT&T

Load the Olivetti faces data-set from AT&T (classification).

Download it if necessary.
PAN:-200840131505

 fetch_20newsgroups(subset=’train’): Data from 20 newsgroups

Load the filenames and data from the 20 newsgroups dataset (classification).

Download it if necessary.

You might also like