Skip to main content

Directions overlay for working with pandas in an analysis environment

Project description

dovpanda

Build Status

Directions OVer PANDAs

Directions are hints and tips for using pandas in an analysis environment. dovpanda is an overlay for working with pandas in an analysis environment.
If you think your task is common enough, it probably is, and Pandas probably has a built-in solution. dovpanda is an overlay module that tries to understand what you are trying to do with your data, and help you find easier ways to write your code.

Usage

Hints

The basic usage of dovpanda is its hints mechanism, which is very easy and out-of-the-box. Just import it after you import pandas

import pandas as pd
import dovpanda

This is it. From now on you can expect dovpanda to come with helpful hints while you are writing you code.

Example

In [3]: df = pd.DataFrame({'a':list('xxyy'),'b':[40,50,60,70], 'time':['18:02','18:45','20:12','21:50']})
   ...: df['time'] = pd.to_datetime(df.time)
   ...: df['hour'] = df.time.dt.hour

In [4]: df.groupby('hour').b.sum()
===== Seems like you are grouping by a column named 'hour', consider setting the your
time column as index and then use df.resample('h') =====
Out[4]:
hour
18    90
20    60
21    70
Name: b, dtype: int64

Notebook Support

Running dovpanda in a notebook environment will display rendered dismissable html. notebook display

Advanced Usage

Random Tips

dovpanda.tip() will give you a random pandas tip.

Change Display

use dovpanda.set_output if you want to change output.

In [14]: dovpanda.set_output('display')

In [15]: df.iterrows()
===== iterrows is not recommended, and in the majority of cases will have better alternatives =====
Out[15]: <generator object DataFrame.iterrows at 0x110fe4318>

In [16]: dovpanda.set_output('print')

In [17]: df.iterrows()
iterrows is not recommended, and in the majority of cases will have better alternatives
Out[17]: <generator object DataFrame.iterrows at 0x112c408b8>

In [18]: dovpanda.set_output('warning')

In [19]: df.iterrows()
WARNING:dovpanda:iterrows is not recommended, and in the majority of cases will have better alternatives
Out[19]: <generator object DataFrame.iterrows at 0x110ee7e58>

In [20]: dovpanda.set_output('off')

In [21]: df.iterrows()
Out[21]: <generator object DataFrame.iterrows at 0x1047c4d68>```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dovpanda-by-guy-0.0.4.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dovpanda_by_guy-0.0.4-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file dovpanda-by-guy-0.0.4.tar.gz.

File metadata

  • Download URL: dovpanda-by-guy-0.0.4.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7

File hashes

Hashes for dovpanda-by-guy-0.0.4.tar.gz
Algorithm Hash digest
SHA256 829f21994faabb4526facf3836a7d07555d492c2b4836f84da2737361b6dc178
MD5 ab46c7721e2aa3a2771b32e8f24b7c68
BLAKE2b-256 561bab370e4057fce19025eaad71ef18271d32eac675c622a4ec7d35df5354ba

See more details on using hashes here.

File details

Details for the file dovpanda_by_guy-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: dovpanda_by_guy-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7

File hashes

Hashes for dovpanda_by_guy-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 970837be697b43e4a9602580f32030d1e84fbb7db9d436f11b79424a450b3d6c
MD5 57b207188138a6571325d3e6205cf728
BLAKE2b-256 114f53a4c38e4961903fa597ce5a491302e08cb5772bce63b30d4d7bef88e342

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page