Skip to main content

A package to allow for basic visuals with pandas dataframes

Project description

easystyle

easystyle is a python package created to allow simple and quick data analysis without having to export to excel. easystyle reads in the data as a dataframe as highlights certain cells depending on what the user calls. The package is heavily dependent on the styling in pandas and pulls some basic code from the Stying pandas documentation. Functions such as identifying, by highlighting the cell or text, the maximum, the minimum, outliers, and NaN values are used in easystyle. These functions allow the user to take a quick look at their data in Jupyter Notebook. It also serves the purpose of showing the data cleaner than with a standard dataframe so that you can present the information to others without having to go to excel.

easystyle works great in Jupyter Notebook, but I am unsure of how well, or if it will work at all, in other environments

Installing easystyle

pip install easystyle

Importing easystyle

The best way to import easystyle is:

from easystyle import Style as es

This is since it makes it simpler to call functions when using the package. For the following examples we will assume this importing method.

Highlight Negative Values

def highlight_negative(df, col = 'red'):

In order to use highlight_negative, the user must provide the dataframe. The user does not need to provide a color, but may do so if they want a color other than red. To run the function:

df = es.highlight_negative(df, color)

Highlight Positive Values

def highlight_positive(df, col = 'green'):

This function follows similarly to the function above. To run the function:

df = es.highlight_positive(df, color)

Highlight Negative and Positive Values

def highlight_neg_pos(df, colNeg = 'red', colPos = 'green'):

Follows from above. To run the function:

df = es.highlight_neg_pos(df, color_neg, color_pos)

Highlight Maximum Value

def highlight_max(df, column_names, col='yellow'):

The function is fed an additional variable, the column names. column_names is an array of the column names that you wish to find the maximum in. For example:

column_names = ['A', 'B', 'C']
df = es.highlight_max(df, column_names, color)

Highlight Minimum Value

def highlight_min(df, column_names, col='orange'):

Follows similarly to highlighting a maximum value. For example:

column_names = ['A', 'B', 'C']
df = es.highlight_min(df, column_names, color)

Highlight Outliers

def highlight_outlier(df, column_names, colLow='red', colUp='red'):

This function uses the IQR method in order to find outliers. Again, column_names is a array of column names. For example:

df = es.highlight_outlier(df, column_names, colorLower, colorUpper)

Highlight NaN Values

def highlight_NaN(df, color = 'red'):

If any NaN values are detected, they are highlighted. For example:

df = es.highlight_NaN(df, color)

Give a Gradient

def highlight_gradient(df, color = 'green'):

This function uses the gradients provided by the Seaborn package. For example:

df = es.highlight_gradient(df, color)

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

easystyle-1.2.1.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file easystyle-1.2.1.tar.gz.

File metadata

  • Download URL: easystyle-1.2.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for easystyle-1.2.1.tar.gz
Algorithm Hash digest
SHA256 c7ccb5b985400b030482b520fc35c8d880188f1f483adc6e143d51b5dccbd6be
MD5 ef91c18d1ee7473b3996f9362ff9dd41
BLAKE2b-256 8870a234ebda11d2ac0780312f42e9c87341b0f5f79c199c731b72177b7ececa

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