Jupyter Notebook
Jupyter Notebook is an open-source, web-based tool that lets users create and share documents with live code, equations, images, and text. This application supports various programming languages, such as Python, R, and Julia, and is widely used by data scientists, researchers, and educators to analyze and visualize data, run tests, and share their findings. Jupyter provides an interactive computing environment where users can run code, see its results, and save and share this process in a file.
One-Click Deployment
With Arvancloud Cloud Container ready-made applications, you can set up Jupyter Notebook with just one click.
Using Jupyter Notebook
After the application is deployed on the Arvancloud Cloud Container, you can access this tool through the free Arvancloud domain or your own domain (if you set it on this application). On the application's first page, you need to enter your token to log in. You can also use this token at the bottom of the page to set a password for Jupyter, so you can use it instead of the token in later logins.
To get the token, go to your application's console in the Cloud Container panel and enter the following command:
jupyter server list
In the output, you see a string like the following, from which you can copy your token and use it in the application:
[JupyterServerListApp] Currently running servers:
[JupyterServerListApp] http://jupyter-notebook-5bb4796564-rrbs9:8888/?token=xxxxxxxxxxxfc68557fbcf0446e57d32aea077xxxxxxxxxx :: /home/jovyan
After logging in to Jupyter Notebook, you can use the Lab version of this application.
Interactive Learning
One of the most popular uses of Jupyter Notebook is in education and communication between instructors and students. For example, in an introductory Python course, you can put sample code and interactive exercises in Jupyter Notebook as follows.
Sample Code for Teaching
# Example code for introducing Python
# Variables
x = 5
y = 10
z = x + y
# Print the value of z
print(z)
# Functions
def add_numbers(a, b):
return a + b
# Call the add_numbers function
result = add_numbers(3, 4)
print(result)
Sample Exercise
# Interactive exercise: Write a function to calculate the area of a rectangle
def calculate_area(width, height):
area = width * height
return area
# Test the function
result = calculate_area(5, 10)
print(result)
Data Processing
Jupyter Notebook is a powerful tool for processing and visualizing data that lets users create interactive charts and graphs from data. For example, suppose we have a dataset of movie ratings and want to examine the relationship between each movie's genre and its rating. With the following code, we can build a bar chart of the average rating of each genre in Jupyter Notebook.
# Import libraries
import pandas as pd
import matplotlib.pyplot as plt
# Load the data
df = pd.read_csv('movie_ratings.csv')
# Calculate the average rating for each genre
avg_ratings = df.groupby('genre')['rating'].mean()
# Create a bar chart of the average ratings
plt.bar(avg_ratings.index, avg_ratings.values)
# Add labels and a title
plt.xlabel('Genre')
plt.ylabel('Average Rating')
plt.title('Average Movie Ratings by Genre')
# Display the chart
plt.show()
For more details, see the Jupyter Notebook documentation.