Getting started with pandas & Mathematica


Mathematica Installation

Mathematica is available for Windows, Linux, and Mac OS X. The software requires a subscription; however, it can be purchased for a discount through an organization such as Cornell University. An individual license costs anywhere from $86 - $300+ per year depending on what extra features you desire, such as email support, computational kernels, and access to the Wolfram Cloud. For more information, please see Wolfram's website at:

https://www.wolfram.com/mathematica/pricing/students/#individual

It is also possible to purchase through the Cornell Software Licensing store for only $35. Select the link below and sign in to your Cornell University account. Once on the page, follow the instructions to complete your purchase. You may use either a credit card or bill through bursar.

https://it.cornell.edu/software-licensing/mathematica-licensing


Getting Started with Mathematica

Once you have Mathematica fully installed on your machine, you will see the following start-up menu:

Example Mathematica notebook

Once a new document is selected, you will see something similar to the page below. You will be able to enter code as seen with the example input (x = 6) and Mathematica will provide some functions it believes may be helpful to you, such as prime factorization and convert to binary tabs. These functions will be specific to whatever code you write and are a helpful way to learn new commands or to use as a shortcut. Remember, to run a line in Mathematica, you must press the Shift AND Enter keys at the same time. Variables that have not been defined will be colored in BLUE and will turn BLACK once assigned a value. GREEN lettering represents "special" variables such as an integration variable or variable being solved for in a system of equations.

Python Installation

  1. First install Anaconda on your computer. This could be found at https://docs.anaconda.com/anaconda/install/index.html. Click on the proper link for your operating system (Windows, macOS, Linux).

  2. Open up the Anaconda Prompt. Then type the following prompt in the window found below and hit enter.

conda install -c conda-forge jupyterlab

3. Once JupyterLab is finished installing, launch Jupyter notebook. This will be launched in a browser.

Getting Started with Pandas

In the top right, you will see the New button. Clicking on this will show a drop down menu. Select Python 3 under 'Notebook' and you will launch a new notebook. In the first line, type "import pandas as pd". Hit Shift+Enter to run this line of code. A new input box will automatically appear. You can also hit 'Enter' to move to the next line in the same box and type more code. Next to the Jupyter logo in the top left, click 'Untitled' to rename the file. You can also do this by going to file and clicking 'Rename'.

You can save your file in a variety of forms (.pdf, .html), but this often requires additional programs such as LaTeX. In the 'Edit' drop down menu, there are a variety of manipulations you can perform such as splitting a cell, cutting and copying a cell, deleting cells and merging cells. To run a cell, click the Run button. For a cell that is taking too long to run, click the square to terminate the cell.