Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 3 additions & 101 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,105 +1,7 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>numpy-financial</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<link rel="stylesheet" href="css/home.css" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<title>
numpy-financial
</title>
<link rel="icon" type="image/png" href="images/numpy_financial_favicon.png" />
<meta http-equiv="refresh" content="0; URL=latest/">
<link rel="canonical" href="https://numpy.org/numpy-financial/latest/">
</head>
<body>
<h1 id="logo"><img src="images/numpy_financial_logoh.svg" title="numpy-financial logo" alt="logo" /></h1>
<aside id="asidelinks">
<h3>Reference Documentation</h3>
<a href="https://numpy.org/numpy-financial/latest/" class="link2">Latest release</a>
<a href="https://numpy.org/numpy-financial/dev/" class="link2">Development version</a>
<h3>Source Code on GitHub</h3>
<a href="https://github.com/numpy/numpy-financial" class="link2">numpy-financial</a>
</aside>
<p>
The numpy-financial Python package is a collection of elementary
financial functions. These functions were copied to this package
from version 1.17 of NumPy.
</p>
<p>The <a href="https://numpy.org/doc/1.17/reference/routines.financial.html">financial functions in NumPy</a>
are deprecated and eventually will be removed from NumPy; see
<a href="https://numpy.org/neps/nep-0032-remove-financial-functions.html">NEP-32</a>
for more information. This package is the replacement for the deprecated
NumPy financial functions.
</p>

<h2 id="installation">Installation</h2>
<p>
The package is available on <a href="https://pypi.org/project/numpy-financial">PyPI</a>, and may be installed
with <code>pip</code>:

<pre>
$ pip install numpy-financial
</pre>

The package requires NumPy version 1.15 or later.
</p>

<h2 id="using">Using <code>numpy_financial</code></h2>
<p>
The importable name of the package is <code>numpy_financial</code>.
The recommended alias is <code>npf</code>. For example,
</p>
<pre>
>>> import numpy_financial as npf
>>> npf.irr([-250000, 100000, 150000, 200000, 250000, 300000])
0.5672303344358536
</pre>

<h2 id="replacing">Switching from <code>numpy</code> to <code>numpy_financial</code></h2>
<ul>
<li>
<p>Code that imports the function names like this
<pre>
from numpy import npv, irr
</pre>
requires only that the import be changed to
<pre>
from numpy_financial import npv, irr
</pre>
</p>
</li>
<li>
<p>For code that uses the <code>numpy</code> namespace like this
<pre>
import numpy as np

x = np.array([-250000, 100000, 150000, 200000, 250000, 300000])
r = np.irr(x)
</pre>
the import statement for the numpy-financial package must be added,
and the calls of the financial functions must be changed to use
the <code>npf</code> namespace:
<pre>
import numpy as np
import numpy_financial as npf

x = np.array([-250000, 100000, 150000, 200000, 250000, 300000])
r = npf.irr(x)
</pre>
</p>
</li>
</ul>

<div id="footer">
&copy; 2019 NumPy-Financial Developers</a>
</div>
</body>
</html>