summaryrefslogtreecommitdiff
path: root/numpy/lib/index_tricks.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-09-14 01:20:52 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-09-14 01:20:52 +0000
commit6359dccac9d940dc3291de360b4cb377183e1b9d (patch)
tree0490020f3dc7a85141f9c89166cf3bd687d30961 /numpy/lib/index_tricks.py
parentaa27298288961201372528c1391bc73348f4efb8 (diff)
downloadnumpy-6359dccac9d940dc3291de360b4cb377183e1b9d.tar.gz
Fix column-stack to not transpose 2-d inputs. Fix iscomplex for strings. Add deprecation warning for c_
Diffstat (limited to 'numpy/lib/index_tricks.py')
-rw-r--r--numpy/lib/index_tricks.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index 0835a69fd..6c864080f 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -225,7 +225,7 @@ class concatenator(object):
if start is None: start = 0
if step is None:
step = 1
- if type(step) is type(1j):
+ if isinstance(step, complex):
size = int(abs(step))
newobj = function_base.linspace(start, stop, num=size)
else:
@@ -281,18 +281,20 @@ class r_class(concatenator):
r_ = r_class()
+import warnings
+
class c_class(concatenator):
"""Translates slice objects to concatenation along the second axis.
- For example:
- >>> c_[array([[1],[2],[3]]), array([[4],[5],[6]])]
- array([[1, 4],
- [2, 5],
- [3, 6]])
+ This is deprecated. Use r_[...,'-1']
"""
def __init__(self):
concatenator.__init__(self, -1)
+ def __getitem__(self, obj):
+ warnings.warn("c_ is deprecated use r_[...,'-1']")
+ return concatenator.__getitem__(self, obj)
+
c_ = c_class()
class ndenumerate(object):
@@ -383,9 +385,6 @@ class ndindex(object):
# Cosmetic changes by T. Oliphant 2001
#
#
-# This module provides a convenient method for constructing
-# array indices algorithmically. It provides one importable object,
-# 'index_expression'.
class _index_expression_class(object):
"""