• 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
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

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Jupyter Notebook Tutorial : Part 1

    Jupyter has notebook that let us to write and execute code, analyze data and do more. Here is How To Install Jupyter Notebook Tutorial.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

  • How To Install and Run iPython/Jupyter Notebook on IBM Bluemix

    This is Old Way of Using Tools Around Big Data and Data Science. Here are Steps on How To Install, Run iPython/Jupyter Notebook on Bluemix.

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 (24.3K 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

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

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

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