Skip to main content

Perform exploratory data analysis (EDA) on quantitative data.

Project description

quanteda

CI/CD codecov Documentation Status License: MIT Python 3.9.0 release version Project Status: Active – The project has reached a stable, usable state and is being actively developed.

Perform exploratory data analysis (EDA) on quantitative financial data.

Function Description

This package aims to be the starting point for any analysis of quantitative financial data by supplying functions that create charts and metrics to simplify exploratory data analysis and give the user a jump-start on their project. This package simplifies the creation of charts that look at the distribution of numeric features and missing information in the data set; two critical steps in any financial analysis. The package also includes a function that will generate a random time series. Financial variables like stock prices and interest rates vary over time, so this ability to generate a time series quickly is extremely useful. Finally, this package also includes a function that will automatically calculate several useful financial metrics so that more time can be spent on more complicated analysis.

The functions in this package include:

  • plot_missing_vals: Plot tick chart to display missing values for all numeric features in the dataset.
  • plot_num_dist: Creates a chart of histograms for all numeric features in a data set.
  • generate_return_series: Generates a DataFrame with independent time series of returns.
  • generate_financial_metrics: Calculates financial metrics based on a DataFrame of random returns on time series. These metrics are total return, annual return, annual volatilities and sharpe ratio

Contributors

  • Doris (Yun Yi) Cai
  • Jake Barnabe
  • John Shiu
  • Merete Lutz

Installation

For User

To install the package, run the following command from the terminal

pip install quanteda

For Developers

  1. Clone this repository.
# If using SSH key:
 git clone git@github.com:UBC-MDS/quanteda.git
 cd quanteda/

# If using HTTP, simply change to HTTP and copy the clone link before following the same procedure
  1. Install the virtual environment.
 conda env create -f environment.yml
  1. Activate the installed environment:
 conda activate quanteda
  1. Install the package.
 poetry install

Usage

Using this package

To use this package, import and call the functions in Python. Below is an example:

from quanteda.plot_missing_vals import plot_missing_vals
from quanteda.plot_num_dist import plot_num_dist
from quanteda.generate_financial_metrics import generate_financial_metrics
from quanteda.generate_return_series import generate_return_series

Call function plot_missing_vals to visualize the presence of missing values. image

Call function plot_num_dist to plot the distribution of the return series. image

Call function generate_financial_metrics to calculate the financial metrics of the return series. image

Call function generate_return_series to simulate time series return given an expected return, volatility and return distribution of a stock.

image

Run unit tests

Execute the following in the project root directory to run the unit tests of the package,

 poetry run pytest

or, to run with the code covergage reporting,

 poetry run pytest --cov=quanteda
 poetry run pytest --cov=quanteda --cov-branch
 poetry run pytest --cov=quanteda --cov-branch --cov-report term-missing

Documentation

The official documentation is hosted on Read the Docs: https://quanteda.readthedocs.io/en/latest/

quanteda in the Python Ecosystem

Our package fills a gap in the python ecosystem by being marketed specifically to financial data. Python users commonly create EDA charts using popular packages like matplotlib, altair, and seaborn, and conduct their financial analysis using packages like pandas, numpy, and scipy. These libraries are extensive, but have been generalized to be as useful as possible to as many differen fields as possible. It takes time to learn the syntax and code of these packages that work for financial data. This can be time consuming during EDA, when the goal is to quickly get a rough idea of what the data set you are using looks like. Our package will simplify these actions into a few functions that will save time on tedious EDA so that more time can be spent on analysis and testing.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

quanteda was created by Doris (Yun Yi) Cai, Jake Barnabe, John Shiu, Merete Lutz. It is licensed under the terms of the MIT license.

Credits

quanteda was created with cookiecutter and the py-pkgs-cookiecutter template.

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

quanteda-2.0.11.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

quanteda-2.0.11-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file quanteda-2.0.11.tar.gz.

File metadata

  • Download URL: quanteda-2.0.11.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for quanteda-2.0.11.tar.gz
Algorithm Hash digest
SHA256 05cb5ebf69e7ee7d2d9324909e74ac8ebfa83926ecad2fc9d96a722e6d63dfb8
MD5 5c181cd5d387a2ecd362f992b9d1f05c
BLAKE2b-256 fb671bd47bc9ab3f0dff7840a97ddc228442bd810fcb632e5956e0098e033402

See more details on using hashes here.

File details

Details for the file quanteda-2.0.11-py3-none-any.whl.

File metadata

  • Download URL: quanteda-2.0.11-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for quanteda-2.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a0c230c01f21ce29c2f4aee8f5790387f926670ad744156c28113a3b9e2a7333
MD5 9e484ec8f4d0391df49cadd86427f603
BLAKE2b-256 14736b062deef4c3af762ac8cba0dd54855fde2fe518d33fdf72d4255d28fe33

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