Skip to content

Commit

Permalink
Update installation instructions in README
Browse files Browse the repository at this point in the history
  • Loading branch information
jvns committed Oct 23, 2024
1 parent ba8d1d3 commit 8953071
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
33 changes: 11 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
Pandas cookbook
===============


Try it with Jupyter Lite
[![lite-badge](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://paddymul.github.io/pandas-cookbook/lab/index.html)

Try it in your browser with Jupyter Lite: [![lite-badge](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://jvns.github.io/pandas-cookbook/lab/index.html)

[pandas](http://pandas.pydata.org/) is a Python library for doing
data analysis. It's really fast and lets you do exploratory work
Expand Down Expand Up @@ -54,40 +51,32 @@ Table of Contents
How to use this cookbook
========================

The easiest way is to try it out instantly online using Binder's awesome service. **[Start by clicking here](https://mybinder.org/v2/gh/jvns/pandas-cookbook/master)**, wait for it to launch, then click on "cookbook", and you'll be off to the races! It will let you run all the code interactively without having to install anything on your computer.
You can try it out instantly online using [Jupyter Lite](https://jvns.github.io/pandas-cookbook/lab/index.html), which will run Python with WebAssembly in your browser.

To install it locally, you'll need Jupyter notebook and pandas on your computer.

You can get these using `pip` (you may want to do this inside a virtual environment to avoid conflicting with your other libraries).

```bash
pip install -r requirements.txt
```
# Get the repository
git clone https://github.com/jvns/pandas-cookbook.git
cd pandas-cookbook

This can be difficult to get set up and require you to compile
a whole bunch of things. I instead use and recommend
[Anaconda](https://store.continuum.io/), which is a Python distribution which
will give you everything you need. It's free and open source.
# Set up a virtual environment
python3 -m venv venv
source venv/bin/activate

Once you have pandas and Jupyter, you can get going!
# Install dependencies
pip install -r requirements.txt

```bash
git clone https://github.com/jvns/pandas-cookbook.git
cd pandas-cookbook/cookbook
# Start jupyter
jupyter notebook
```

A tab should open up in your browser at `http://localhost:8888`

Happy pandas!

Running Jupyterlite locally
===========================
```bash
#assuming you checked out into ~/code/pandas-cookbook
cd ~/code/pandas-cookbook/ ; rm -rf _output ; time jupyter lite build --contents ./cookbook/ && cd _output && python -m http.server
```

Running the cookbook inside a Docker container.
===============================================================
This repository contains a Dockerfile and can be built into a docker container.
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
matplotlib==3.7.1
numpy==1.22.3
pandas==1.4.2
jupyter==1.0.0
pandas==2.2.3
jupyter==1.1.1
numpy==2.1.2
matplotlib==3.9.2

0 comments on commit 8953071

Please sign in to comment.