JupyterLAb
-
JupyterLab is a next-generation web-based user interface for Project Jupyter.
- JupyterLab enables you to work with documents and activities such as Jupyter notebooks, text editors, terminals, and custom components in a flexible, integrated, and extensible manner.
-
Code Consoles provide transient scratchpads for running code interactively, with full support for rich output. A code console can be linked to a notebook kernel as a computation log from the notebook, for example.
-
Kernel-backed documents enable code in any text file (Markdown, Python, R, LaTeX, etc.) to be run interactively in any Jupyter kernel.
-
Notebook cell outputs can be mirrored into their own tab, side by side with the notebook, enabling simple dashboards with interactive controls backed by a kernel.
- Multiple views of documents with different editors or viewers enable live editing of documents reflected in other viewers. For example, it is easy to have live preview of Markdown, Delimiter-separated Values, or Vega/Vega-Lite documents.
- JupyterLab also offers a unified model for viewing and handling data formats. JupyterLab understands many file formats (images, CSV, JSON, Markdown, PDF, Vega, Vega-Lite, etc.)
- It can also display rich kernel output in these formats. See File and Output Formats for more information.
NumPy
- NumPy is a commonly used Python data analysis package.
Creating A NumPy Array
# by import files
import csv
with open("winequality-red.csv", 'r') as f:
wines = list(csv.reader(f, delimiter=";"))
import numpy as np
wines = np.array(wines[1:], dtype=np.float)
import numpy as np
empty_array = np.zeros((3,4))
empty_array
Using NumPy To Read In Files
wines = np.genfromtxt("winequality-red.csv", delimiter=";", skip_header=1)
Slicing NumPy Arrays
using a colon (:). A colon indicates that we want to select all the elements from the starting index up to but not including the ending index.
wines[:3,3]
array([ 1.9, 2.6, 2.3])
N-Dimensional NumPy Arrays
earnings = [
[
[500,505,490],
[810,450,678],
[234,897,430],
[560,1023,640]
],
[
[600,605,490],
[345,900,1000],
[780,730,710],
[670,540,324]
]
]
NumPy Array Operations
ny of the basic mathematical operations (/, *, -, +, ^) with an array and a value, it will apply the operation to each of the elements in the array.