From 6359dccac9d940dc3291de360b4cb377183e1b9d Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Thu, 14 Sep 2006 01:20:52 +0000 Subject: Fix column-stack to not transpose 2-d inputs. Fix iscomplex for strings. Add deprecation warning for c_ --- numpy/lib/index_tricks.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'numpy/lib/index_tricks.py') 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): """ -- cgit v1.2.1