diff --git a/root_numpy/_utils.py b/root_numpy/_utils.py index 0d92544..e18fcc5 100644 --- a/root_numpy/_utils.py +++ b/root_numpy/_utils.py @@ -17,10 +17,6 @@ VLEN = np.vectorize(len) -def _is_object_field(arr, col): - return arr.dtype[col] == 'O' - - def rec2array(rec, fields=None): """Convert a record array into a ndarray with a homogeneous data type. @@ -72,7 +68,7 @@ def stack(recs, fields=None): return np.hstack([rec[fields] for rec in recs]) -def stretch(arr, fields): +def stretch(arr, fields=None): """Stretch an array. Stretch an array by ``hstack()``-ing multiple array fields while @@ -83,8 +79,8 @@ def stretch(arr, fields): ---------- arr : NumPy structured or record array The array to be stretched. - fields : list of strings - A list of column names to stretch. + fields : list of strings, optional (default=None) + A list of column names to stretch. If None, then stretch all fields. Returns ------- @@ -103,44 +99,51 @@ def stretch(arr, fields): dtype=[('scalar', '