summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelissa Weber Mendonça <melissawm@gmail.com>2021-02-15 11:58:24 -0300
committerGitHub <noreply@github.com>2021-02-15 11:58:24 -0300
commit46e984e9f93774570b9d15288f3c24f5e0cae63e (patch)
tree18a796846883304234d2e5053776b682f4c3ac03
parent9fd5ca55cc8c76759927831f44a98e2c65ea73d1 (diff)
parentb15bd82a7b50e721125b54f8cc11a0850ce10a21 (diff)
downloadnumpy-46e984e9f93774570b9d15288f3c24f5e0cae63e.tar.gz
Merge pull request #18405 from mdubravski/correlateFix
DOC: Mention `scipy.signal.correlate` and FFT method in `np.correlate`
-rw-r--r--numpy/core/numeric.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index 89f56fa09..7675386e7 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -710,6 +710,7 @@ def correlate(a, v, mode='valid'):
--------
convolve : Discrete, linear convolution of two one-dimensional sequences.
multiarray.correlate : Old, no conjugate, version of correlate.
+ scipy.signal.correlate : uses FFT which has superior performance on large arrays.
Notes
-----
@@ -720,6 +721,11 @@ def correlate(a, v, mode='valid'):
which is related to ``c_{av}[k]`` by ``c'_{av}[k] = c_{av}[-k]``.
+ `numpy.correlate` may perform slowly in large arrays (i.e. n = 1e5) because it does
+ not use the FFT to compute the convolution; in that case, `scipy.signal.correlate` might
+ be preferable.
+
+
Examples
--------
>>> np.correlate([1, 2, 3], [0, 1, 0.5])