GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - datathink/python4DSpolars: Python for Data Science. This repository hosts the code behind the online book that teaches you how to use Polars and LetsPlot in Python for data science.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

234 Commits
234 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
conversion_scripts
conversion_scripts
 
 
data
data
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
_quarto.yml
_quarto.yml
 
 
boolean-data.ipynb
boolean-data.ipynb
 
 
categorical-data.ipynb
categorical-data.ipynb
 
 
command-line.md
command-line.md
 
 
communicate-plots.ipynb
communicate-plots.ipynb
 
 
data-import.ipynb
data-import.ipynb
 
 
data-tidy.ipynb
data-tidy.ipynb
 
 
data-transform.ipynb
data-transform.ipynb
 
 
data-visualise.ipynb
data-visualise.ipynb
 
 
databases.ipynb
databases.ipynb
 
 
dataframe_illustration.svg
dataframe_illustration.svg
 
 
dates-and-times.ipynb
dates-and-times.ipynb
 
 
exploratory-data-analysis.ipynb
exploratory-data-analysis.ipynb
 
 
favicon.ico
favicon.ico
 
 
functions.ipynb
functions.ipynb
 
 
index.md
index.md
 
 
introduction.ipynb
introduction.ipynb
 
 
iteration.ipynb
iteration.ipynb
 
 
joins.ipynb
joins.ipynb
 
 
logo.png
logo.png
 
 
logo.py
logo.py
 
 
markdown.md
markdown.md
 
 
missing-values.ipynb
missing-values.ipynb
 
 
numbers.ipynb
numbers.ipynb
 
 
panache.toml
panache.toml
 
 
plot_style.txt
plot_style.txt
 
 
prerequisites.ipynb
prerequisites.ipynb
 
 
pyproject.toml
pyproject.toml
 
 
quarto.qmd
quarto.qmd
 
 
rectangling.ipynb
rectangling.ipynb
 
 
references.bib
references.bib
 
 
references.md
references.md
 
 
regex.ipynb
regex.ipynb
 
 
spreadsheets.ipynb
spreadsheets.ipynb
 
 
strings.ipynb
strings.ipynb
 
 
uv.lock
uv.lock
 
 
version_bumper.py
version_bumper.py
 
 
vis-layers.ipynb
vis-layers.ipynb
 
 
visualise.qmd
visualise.qmd
 
 
webscraping-and-apis.ipynb
webscraping-and-apis.ipynb
 
 
whole-game.ipynb
whole-game.ipynb
 
 
workflow-basics.ipynb
workflow-basics.ipynb
 
 
workflow-help.qmd
workflow-help.qmd
 
 
workflow-packages-and-environments.qmd
workflow-packages-and-environments.qmd
 
 
workflow-style.ipynb
workflow-style.ipynb
 
 
workflow-writing-code.ipynb
workflow-writing-code.ipynb
 
 

Repository files navigation

Python for Data Science

DOI GitHub Release

This is the repo for Python for Data Science.

This README is for developers and contributors. If you're here to read the book, head over to https://aeturrell.github.io/python4DS.

Contributing

We are very keen to encourage contributors! You can contribute by raising issues with the book or by creating pull requests directly. If you are creating a pull request you will need to install the development environment locally and check the book builds after you've made your changes.

Note that we aim to closely follow the content of R for Data Science (2e).

Before making a pull request you should test that the pre-commit checks pass, including that there are no outputs included, and that the book builds. See below for instructions on how to do these locally.

When you make a pull request, pre-commit and build will run automatically, and fail if there are errors. They are in .github/workflows/tests.yml.

Installing the development environment locally

You will need installations of Python 3.10 and uv. uv can be used to install certain distributions of Python through the uv python install 3.12 command but you can use other Python installations.

Clone this repository.

To install the development environment, run uv sync from the project root. This should create a .venv/ directory with the Python4DS environment in it. You can check that the environment has been installed by running uv run python -V in the project root directory.

Building the book

The book is compiled from source markdown and Jupyter notebook files using Quarto. You will need Quarto installed on your system — see the Quarto installation guide.

To build the book, run

uv run quarto render --execute

Once this command is run, you should be able to look at the HTML files for the book locally on your computer. They will be in _book. The freeze: auto setting means only notebooks whose source has changed will be re-executed on subsequent builds.

Uploading the book

Automatic uploads of the book

This repo is configured such that new versions automatically build and upload the book to the website. The GitHub Action that does this is in .github/workflows/release.yml.

Uploading the built book manually

You shouldn't need to upload the book if you are a regular contributor. There are times when you might need to as an admin, but normally the book will be updated automatically upon release of a new version.

First build the book, then publish with:

uv run quarto publish gh-pages --no-render --no-browser

Code hygiene

This book uses pre-commit to strip output from notebooks, lint, format, and check for large files added by mistake.

To perform the pre-commit checks, use

uv run pre-commit run --all-files

on your staged files. Ensure pre-commit reports all tests as having passed before committing.

Publishing a new version

  1. Open a new branch with the version name, eg v1.0.4

  2. Change the version in pyproject.toml (you can run uv run version_bumper.py, which has script-level dependencies)

  3. Commit the change with a new version label (eg v1.0.4) as the commit message

  4. Go to GitHub. Assuming the tests pass, merge into main.

  5. The book should automatically build in GitHub actions, and be pushed to the website. A new release will also be created automatically. A new Zenodo entry is also automatically created.

Running and developing in a Docker container

There is a Dockerfile associated with this project. To use it:

  1. Pre-reqs: docker installed, VS Code installed, VS Code docker and Remote Explorer extensions installed.
  2. Build the image from the file. Right click on the file in VS Code and select "Build Image".
  3. On the Docker tab of VS Code, right-click on the python4DS:latest image and select 'Run Interactive'.
  4. On the Docker tab again, right-click on the running python4DS:latest container and click "Attach Visual Studio Code".
  5. Do any development as required (see the instructions above)

If you wish to copy any files (eg the built HTML files) back to your local machine to check them, use

docker cp CONTAINER:app/_book/ temp_dir/

About

Python for Data Science. This repository hosts the code behind the online book that teaches you how to use Polars and LetsPlot in Python for data science.

www.python4ds.com/

Resources

Readme
License
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.