• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Jupyter Notebook Tutorial : Part 2

By Abhishek Ghosh September 17, 2017 2:55 pm Updated on September 17, 2017

Jupyter Notebook Tutorial : Part 2

Advertisement

In Part 2 of our Jupyter Notebook Tutorial series, we will learn installing packages in Jupyter, importing data, plotting inline etc works. Our Part 1 of Jupyter Notebook Tutorial was on how to install on localhost or server – on Mac OS X or GNU/Linux. For quick recapitulation to unused with Python, normally on terminal, if you run :

Vim
1
python

then it will start Python interactive command shell like this :

Vim
1
2
3
4
Python 2.7.13 (default, Jun 24 2017, 02:53:00)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

To obtain current directory, we first will run :

Advertisement

---

Vim
1
import os

then :

Vim
1
os.getcwd()

To exit that shell, we will type :

Vim
1
exit()

If you type :

Vim
1
ipython

you’ll get enhanced interactive Python shell.

Jupyter Notebook Tutorial Part 2

 

Jupyter Notebook Tutorial : Part 2

 

Now open Jupyter Notebook on browser like we talked in Part 1 of this series. On the right hand side there will be a “New” dropdown menu. If you click it, that first option will be “Python3” (which you’ll normally click to start works), other options includes a terminal. You’ll see the input field :

Vim
1
In [ ]

Copy paste this :

Vim
1
print("The answer is", 2*2)

then click the RUN button, which should return “The answer is 4”. If you want a LaTeX output, run this :

Vim
1
2
from IPython.display import display, Math, Latex
display(Math(r'sqrt{a^2 + b^2}'))

For the next steps of guides, you need to install :

  1. Pandas
  2. NumPy
  3. SciPy
  4. Plotly
  5. matplotlib

via pi. For Mac OS X appendicectomy sudo -H before the commands and run :

Vim
1
2
3
4
5
pip install pandas
pip install numpy
pip install scipy
pip install plotly
pip install matplotlib

pip install numpy will show that previous command already installed it. Now again freshly launch Jupyter notebook with the command :

Vim
1
jupyter notebook

In that Jupiter notebook’s input, enter this and run, which is example of using Plotly :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import plotly.plotly as py
from plotly.graph_objs import *
 
import pandas as pd
 
mapbox_access_token = 'pk.eyJ1IjoiY2hlbHNlYXBsb3RseSIsImEiOiJjaXFqeXVzdDkwMHFrZnRtOGtlMGtwcGs4In0.SLidkdBMEap9POJGIe1eGw'
 
json_data = pd.read_json('https://raw.githubusercontent.com/ottlngr/2016-15/ottlngr/ottlngr/sites.json')
rating_one_site_lat = []
rating_one_site_lon = []
locations_name = []
 
for index in range(len(json_data)):
    if json_data['locations'][index] != []:
        if json_data['site'][index]['rating'] == 1:
            rating_one_site_lat.append(json_data['locations'][index][0]['latitude'])
            rating_one_site_lon.append(json_data['locations'][index][0]['longitude'])
            locations_name.append(json_data['site'][index]['name'])
 
data = Data([
    Scattermapbox(
        lat=rating_one_site_lat,
        lon=rating_one_site_lon,
        mode='markers',
        marker=Marker(
            size=18,
            color='rgb(155, 240, 225)',
            opacity=0.7
        ),
        text=locations_name,
        hoverinfo='text'
    ),
    Scattermapbox(
        lat=rating_one_site_lat,
        lon=rating_one_site_lon,
        mode='markers',
        marker=Marker(
            size=8,
            color='rgb(205, 245, 100)'
        ),
        hoverinfo='skip'
    )]
)
        
layout = Layout(
    title='Nuclear Waste Sites on Campus',
    autosize=True,
    hovermode='closest',
    showlegend=False,
    mapbox=dict(
        accesstoken=mapbox_access_token,
        bearing=0,
        center=dict(
            lat=38,
            lon=-94
        ),
        pitch=0,
        zoom=3,
        style='dark'
    ),
)
 
fig = dict(data=data, layout=layout)
py.iplot(fig, filename='jupyter/Nuclear Waste Sites on American Campuses')

Tagged With jupyter notebook tutorial , Dr A Doc Ghosh , orthopedic surgeon Porashor ghosh , pk eyj1ijoiy2hlbhnlyxbsb3rsesisimeioijjaxfqexvzddkwmhfrznrtogtlmgtwcgs4in0 slidkdbmeap9pojgie1egw , plotly jupiter notebook does not display offline

This Article Has Been Shared 276 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Jupyter Notebook Tutorial : Part 2

  • Installing Local Data Lake on Ubuntu Server : Part 1

    Here is Part 1 of Installing Local Data Lake on Ubuntu Server With Hadoop, Spark, Thriftserver, Jupyter etc To Build a Prediction System.

  • Install Apache Mahout : Ubuntu 16.04 For Machine Learning Dev

    Here Is How To Install Apache Mahout On Ubuntu 16.04 For Machine Learning Development. We Can Install & Integrate Mahout With Spark, Hadoop.

  • IBM Analytics Demo Cloud : Free Hadoop, Ambari With SSH

    IBM Analytics Demo Cloud is intended to learn Hadoop, Ambari, BigSQL free of cost with SSH access & web console. Here is how to get started.

  • Create Data Science Environment on Cloud Server With Docker

    Here Are the Steps, Commands to Create Data Science Environment on Cloud Server For Data Analysis Starting With a Blank Server With SSH.

  • How To Install Hue on Ubuntu 16.04

    Hue is Query Tool With GUI For Browsing, Querying, Visualizing Data & Developing Apps for Hadoop. Here is How To Install Hue on Ubuntu 16.04.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (22.1K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • The Cost of Doing Business as a Handyman July 1, 2022
  • Samsung Galaxy S22 Ultra: Long Term Review June 30, 2022
  • How to Make the Most of Your S Pen (S22 Ultra) June 29, 2022
  • Safe Chargers for Samsung Galaxy S22 Ultra June 27, 2022
  • How Telecoms Can Use The Cloud To Power Their 5G Network June 24, 2022

About This Article

Cite this article as: Abhishek Ghosh, "Jupyter Notebook Tutorial : Part 2," in The Customize Windows, September 17, 2017, July 2, 2022, https://thecustomizewindows.com/2017/09/jupyter-notebook-tutorial-part-2/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2022 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy