Skip to main content

Why even wait for autocompletion when you can use `pandas_shortcuts`?

Project description

pandas-shortcuts

.

. . .

Why even wait for autocompletion when you can use pandas_shortcuts?

How to use

  • Simply import pandas_shortcuts together with pandas.

    import pandas as pd
    import pandas_shortcuts
    
  • Every pd.DataFrame and pd.Series objects will have:

    • shortcuts (full list below)
    # shortcut for `df.head()`
    df.h()
    
    # shortcut for df.columns
    df.c
    
    # shortcut for df["col"].unique()
    df["col"].u()
    
    • new methods (full list below)
    # view up to `r` rows and `c` columns of a dataframe, overiding pandas' default limit
    df.v()  # default r=50, c=50
    
    # view up to `r` rows of a series, overiding pandas' default limit
    df["col"].v(100)
    
    # stylize a dataframe's numeric columns as heatmap or bars
    # view up to `r` rows and `c` of a dataframe, overiding pandas' default limit
    df.sh()  # style=heatmap
    df.sb()  # style=bar
    
    # call `dtale.show`, refer to dtale docs for details
    df.dt()
    
    # call `pandas_profiling.ProfileReport`, refer to pandas_profiling docs for details
    df.pp()
    

Available Shortcuts and Methods

# Heads or tails
df.h(...)  # df.head(...)
df.t(...)  # df.tail(...)
df["col"].h(...)  # df["col"].head(...)
df["col"].t(...)  # df["col"].tail(...)

# Sort
df.si(...)  # df.sort_index(...)
df["col"].si(...)  # df["col"].sort_index(...)
df.sv(...)  # df.sort_values(...)
df["col"].sv(...)  # df["col"].sort_values(...)

# Index
df.sx(...)  # df.set_index(...)
df.rx(...)  # df.reset_index(...)
df["col"].rx(...)  # df["col"].reset_index(...)

# Groupby
df.gb(...)  # df.groupby(...)
df["col"].gb(...)  # df["col"].groupby(...)

# Duplicates
df.dd(...)  # df.drop_duplicates(...)
df["col"].dd(...)  # df["col"].drop_duplicates(...)
df.dup(...)  # df.duplicated(...)
df["col"].dup(...)  # df["col"].duplicated(...)
df["col"].u(...)  # df["col"].unique(...)

# Properties
df.c  # df.columns
df.i  # df.index
df["col"].i  # df["col"].index


# Methods
df.v(...)
df["col"].v(...)
df.sh(...)
df.sb(...)
df.dt(...)
df.pp(...)

Note

  • Some dependencies (pandas_profiling's numba and llvmlite) do not support Python 3.9 as of pandas_shortcuts v0.0.1
  • df.v() directly generates IPython.core.display.HTML object under the hood, thus completely bypassing any pd.set_option("display.max_rows", ...) and pd.set_option("display.max_columns", ...) that the user may have specified.

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

pandas_shortcuts-0.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

pandas_shortcuts-0.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file pandas_shortcuts-0.0.1.tar.gz.

File metadata

  • Download URL: pandas_shortcuts-0.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for pandas_shortcuts-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8aa007a69ce2071315e3f028aa3656695dec87a056b4195827811bd5c8fcc728
MD5 fc72d8a88396ce808716dc80cf6538a1
BLAKE2b-256 f6823e6ff056dd7ad0acf2554d330df6309c2d2862c240456f09f78910e5e435

See more details on using hashes here.

File details

Details for the file pandas_shortcuts-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pandas_shortcuts-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for pandas_shortcuts-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a915a23219f38d9fbc0e6df61c2c9356fa3c11ac0fbae4bfb48705bd86d8d2a
MD5 289ac4e935241887d513d4813c9abf1f
BLAKE2b-256 2c6c42dc024f6640083a9f2588541eb7fee414143d4e02e1d37f5a3e77160d8e

See more details on using hashes here.

Supported by

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