Getting Started With Jupyter Notebooks In Cocalc

Leo Migdal
-
getting started with jupyter notebooks in cocalc

Before you start, you need to create a Cocalc account and add your partner as a collaborator [TODO: Link to instructions] Navigate to www.cocalc.com and sign in using your university email address. Click on project NSCI0007_20_21 in the project list to load your project. Your project is essentially a virtual computer hosted in the cloud, and it comes preinstalled with all the software and tools you need to get Python programming straight away! Click on the Handouts folder then the 01_Introduction folder. DEFINITIONS: Cocalc - the online platform we will be using, providing access to virtual computers hosted in the cloud.

Project - Every student has a Cocalc account allowing access to a project, which is a virtual computer including operating system (Linux) and software libraries. Jupyter Notebook - a type of file which contains Python code and formatted text, allowing us to combine computations, results and descriptive text in a single file. It is also sometimes called an IPython Notebook, and has the extension .ipynb. Python - the programming language allowing us to perform scientific computing. You are currently viewing a Jupyter notebook file on CoCalc. Jupyter notebooks are composed of cells.

Cells can be of three types: code, Markdown, or raw. This cell you’re reading is Markdown, a simple language for formatting rich text. The cell below is a code cell, where you can write and run Python commands. Raw cells are “raw” text — they aren’t fancy-formatted Markdown, and they aren’t run-able as code. They also aren’t terribly useful. Cells have two modes: edit and command.

Edit mode is indicated by a green border around the cell, while command mode has a blue border. In edit mode, you can type into the cell and edit it. In command mode, you can run the cell, or manipulate it in certain ways (e.g., deleting a whole cell, or moving it). You execute (run) cells by selecting them (by clicking once on the cell) and then pressing the Shift & Enter keys on your keyboard simultaneously. Double-clicking a cell will make it editable. If you double-click on this (or any other Markdown) cell, the text will change to a fixed-width font and you’ll see the Markdown formatting tags (like # for headings).

Try it! Then hit Shift & Enter to execute the cell (which applies and renders the Markdown formatting). Below is a code cell with some very simple Python code. You haven’t started learning Python yet, but as you can see, at its simplest Python can act like a calculator. Try executing the cell and see what happens. The course management interface gives you full control over distributing, collecting, grading and returning everyone's assignments.

Contact [email protected] or request a live demo! As the official page of the Jupyter project states: A notebook is a shareable document that combines computer code, plain language descriptions, data, rich visualizations like 3D models, charts, graphs and figures, and interactive controls. A notebook, along with an editor (like JupyterLab), provides a fast interactive environment for prototyping and explaining code, exploring and visualizing data, and sharing ideas with others. Nowadays a Jupyter Notebook is a de facto standard document format, typically stored in .ipynb files, which records interactive sessions with a kernel. It is made up of cells, which can either store one or more lines of code or formatted text.

When you run a code cell, the active kernel session evaluates the piece of code in it and the resulting output is shown below. The combination of communicating back and forth with a kernel and adding descriptive text makes this form of document very attractive. CoCalc has its own implementation of the user interface to work with Jupyter Notebooks, which supports our unique features such as real-time collaboration, AI Assistant, and TimeTravel. However, the underlying format of .ipynb files is exactly the same. You can bring your existing notebooks to CoCalc and resume working, or you can download your work from CoCalc to a local computer or another cloud platform, there is no vendor-lock-in! Most of the time you don’t have to think much about the Jupyter kernel which you are using, because your notebook already has the right kernel selected or your default kernel is picked automatically...

But when you want or need to, you can choose the programming language and environment by selecting a kernel explicitly. See Jupyter Kernel Selection CoCalc: Collaborative Calculations and Data Science CoCalc allows you to easily use basic and advanced GPUs, as well as machines with a lot of CPU cores and RAM! See Compute Servers for details. Jupyter Widgets are Python objects that let you build interactive GUIs for your Jupyter notebooks.

A good way to get started using Jupyter widgets is to go through the Widget List. In CoCalc widgets are fully collaborative, meaning that you and your collaborators share and see exactly the same state of them. This is different from most other platforms, where changes to controls made by one user are not visible to another. CoCalc Jupyter notebook with Jupyter Widgets For more information on the implementation watch 📺 Jupyter Widgets in CoCalc. You can protect cells from being modified or deleted using Edit > Protect menu.

Note that this only prevents accidental edit and delete operations via regular interface. It is easy to bypass this protection using other means or turn it off via Edit > Remove Protection. We will be using an online platform called Cocalc to run and edit notebooks which run Python code. Cocalc is a collaborative computing platform, which means that you can interactively share your code with other users of the platform. After completing this worksheet, you will be able to: ALL students must do Part 1 Step 1 to set up a new Cocalc project for NSCI0007.

The remainder was included in last year’s module NSCI0010 so you only need to do this if you didn’t do that course or if you want to refresh your understanding. Follow the the instruction below to create a Cocalc account and run a notebook file.

People Also Search

Before You Start, You Need To Create A Cocalc Account

Before you start, you need to create a Cocalc account and add your partner as a collaborator [TODO: Link to instructions] Navigate to www.cocalc.com and sign in using your university email address. Click on project NSCI0007_20_21 in the project list to load your project. Your project is essentially a virtual computer hosted in the cloud, and it comes preinstalled with all the software and tools yo...

Project - Every Student Has A Cocalc Account Allowing Access

Project - Every student has a Cocalc account allowing access to a project, which is a virtual computer including operating system (Linux) and software libraries. Jupyter Notebook - a type of file which contains Python code and formatted text, allowing us to combine computations, results and descriptive text in a single file. It is also sometimes called an IPython Notebook, and has the extension .i...

Cells Can Be Of Three Types: Code, Markdown, Or Raw.

Cells can be of three types: code, Markdown, or raw. This cell you’re reading is Markdown, a simple language for formatting rich text. The cell below is a code cell, where you can write and run Python commands. Raw cells are “raw” text — they aren’t fancy-formatted Markdown, and they aren’t run-able as code. They also aren’t terribly useful. Cells have two modes: edit and command.

Edit Mode Is Indicated By A Green Border Around The

Edit mode is indicated by a green border around the cell, while command mode has a blue border. In edit mode, you can type into the cell and edit it. In command mode, you can run the cell, or manipulate it in certain ways (e.g., deleting a whole cell, or moving it). You execute (run) cells by selecting them (by clicking once on the cell) and then pressing the Shift & Enter keys on your keyboard si...

Try It! Then Hit Shift & Enter To Execute The

Try it! Then hit Shift & Enter to execute the cell (which applies and renders the Markdown formatting). Below is a code cell with some very simple Python code. You haven’t started learning Python yet, but as you can see, at its simplest Python can act like a calculator. Try executing the cell and see what happens. The course management interface gives you full control over distributing, collecting...