Skip to content

mrcinv/pandas-cookbook

 
 

Repository files navigation

Recepti za Pandas

Ta dokument je prevod priročnika Pandas Cookbook avtorice Julije Evans.

Binder

pandas je knjižnica za Python namenjena analizi podatkov. Deluje zelo hitro in omogoča uporabniku izjemno hitro interaktivno delo s podatki.

Namen te zbirke receptov je predstaviti nekaj konkretnih primerov, da bi lažje začeli uporabljati pandas. Dokumentacija je zelo izčrpna. A pogosto so mi ljudje rekli, da so imeli težave, ker niso vedeli kako začeti. Ti primeri uporabljajo podatke iz resničnega sveta in vse težave in čudaštva, ki spadajo k realnim podatkom.

Delam s temi seti podatkov

  • klici na 311 v New Yorku
  • število kolesarjev na kolesarskih poteh v Montréalu v letu 2012
  • vreme v Montrealu za leto 2012 po urah

Baterije (podatki) so vključeni, zato lahko začneš takoj sam poskušati vse prikazane primere.

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, 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.

To install it locally , you'll need an up-to-date version of IPython Notebook (>= 3.0) and n your computer pandas (>=0.13) for this to work properly. It's set up to work with Python 2.7.

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

  pip install -r requirements.txt

This can be difficult to get set up and require you to compile a whole bunch of things. I instead use and recommend Anaconda, which is a Python distribution which will give you everything you need. It's free and open source.

Once you have pandas and IPython, you can get going!

git clone https://github.com/jvns/pandas-cookbook.git
cd pandas-cookbook/cookbook
ipython notebook

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

Happy pandas!

Running the cookbook inside Docker container.

This repository contains Dockerfile and can be built into a docker container. To build the container run following command from inside of the repository directory:

docker build -t jvns/pandas-cookbook -f Dockerfile-Local .

run the container:

docker run -d -p 8888:8888 -e "PASSWORD=MakeAPassword" <IMAGE ID>

you can find out about the id of the image, by checking

docker images

After starting the container, you can access ipython notebook with the cookbook on port 8888. Remember to use https and authenticate with MakeAPassword.

https://<docker ip>:8888

Contribute!

If you see something wrong, or there's something you'd like to learn that I haven't explained here, or there's something you know about that you would like to share, create an issue! Send me email! Send a pull request!

TODO

  • Joining dataframes
  • Using stack/unstack
  • ???

License

Creative Commons License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

Translations

There's a translation into Chinese of this repo.

About

Recipes for using Python's pandas library

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%