Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

1.Python_InstallationBasicDataExplorationTutorial_1c056cc97ded2b09309f50ad73d3b7ae

This document provides a step-by-step guide for installing Python and Jupyter Lab/Notebook. It includes instructions for launching Jupyter Lab, creating a new notebook, and running sample code to read data from an Excel file and create a bar chart. Users are advised to complete the installation before the next class and practice running the provided code.

Uploaded by

Tanusri Sen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

1.Python_InstallationBasicDataExplorationTutorial_1c056cc97ded2b09309f50ad73d3b7ae

This document provides a step-by-step guide for installing Python and Jupyter Lab/Notebook. It includes instructions for launching Jupyter Lab, creating a new notebook, and running sample code to read data from an Excel file and create a bar chart. Users are advised to complete the installation before the next class and practice running the provided code.

Uploaded by

Tanusri Sen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1/9/24, 7:27 PM PythonExerciseSample

Steps for initial installation of python and jupyter


lab/notebook:
1. First install python in your computer from this site: https://www.python.org/downloads.
2. After the python installation is completed, you will install the jupyter lab where you will write and execute python
code. For this go to your command prompt. Then type in the command prompt: pip install jupyterlab. This will install
Jupyter notebook in your machine.
3. Now type jupyter lab in the command prompt. Your jupyter lab will be launched. Select the python kernel.
4. Open a new notebook: Go to File-->New -->Notebook.
5. For the first practice, Replicate what you see in this notebook: Type the following lines of code. And run each cell after
you finish typing the code. This first task reads a data from an excel file called ecommerceRevenue and creates a bar
chart. The excel file is provided in moodle for your use. Download the file first to your computer.

(Note that Everytime yuou have to open the jupyter session you need to go to the command prompt and type jupyter
lab)

By the next class finish installing python and jupyter lab. And try running the following codes in your jupyter notebook.

In [1]: import pandas as pd


import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline

In [2]: df=pd.read_excel('C:/Users/Anubhuti_Parajuli/Downloads/ecommerceRevenue.xlsx', sheet_name='Data')

In [3]: plt.figure(figsize=(8,4))
plt.bar(df['Continents'],df['Revenue'])
plt.title('Revenue by Continents')

Out[3]: Text(0.5, 1.0, 'Revenue by Continents')

In [ ]:

localhost:8888/lab 1/1

You might also like