Money type for pandas
Project description
Moneypandas
Moneypandas is a prototype fork of Cyberpandas for currency, using the money
library. Even this README is shamelessly purloigned, with thanks to Tom Augspurger and the ContinuumIO team.
This package provides support for storing currency data inside a pandas DataFrame using pandas' Extension Array Interface
In [1]: from moneypandas import MoneyArray
In [2]: import pandas as pd
In [3]: df = pd.DataFrame({"money": MoneyArray(['1284 EUR', '121 EUR', '€14'])})
In [4]: df
Out[4]:
money
0 EUR 1,284.00
1 EUR 121.00
2 EUR 14.00
For more examples, including summing and converting mixed-currency columns, see the examples
folder.
(note: not yet tested with Conda, only setuptools/pipenv)
To efficiently perform operations, aggregation is done per currency first, and then XMoney used to do necessary operations on the output aggregates.
Currency conversion of a Series only uses XMoney and conversion where currencies mismatch, so converting a column mostly of BBBs, with a few AAAs, should scale according to the number of AAAs.
TODO
- implement more reduce functions
- testing for arithmetic
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
Built Distribution
Hashes for moneypandas-0.9.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60225a6c171d71f7bd264c62050ebda198609528ae120515f1d08541d3f7f7d8 |
|
MD5 | 03d93c924949abf674a95b74028be671 |
|
BLAKE2b-256 | 92b5e4e86ab3986ef9ffd6690a2b3048dfb1f21eed4284a8388274bb4664ae2d |