Changeset 6456 for branches/numpy/anuga/utilities/numerical_tools.py
- Timestamp:
- Mar 5, 2009, 8:29:28 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy/anuga/utilities/numerical_tools.py
r6441 r6456 249 249 typecode: numeric type. If specified, use this in the conversion. 250 250 If not, let numeric package decide. 251 numpy assumes float64 if no type in A.252 251 typecode will always be one of num.float, num.int, etc. 253 252 … … 258 257 """ 259 258 260 if isinstance(A, basestring): 261 msg = 'Sorry, cannot handle string in ensure_numeric()' 259 #if isinstance(A, basestring): 260 if isinstance(A, str): 261 msg = 'ASorry, cannot handle strings in ensure_numeric()' 262 262 raise Exception, msg 263 264 try: 265 elt = A[0] 266 except TypeError: 267 pass 268 else: 269 if isinstance(A, basestring): 270 msg = 'BSorry, cannot handle strings in ensure_numeric()' 271 raise Exception, msg 272 263 273 264 274 if typecode is None: … … 271 281 272 282 273 274 275 283 def histogram(a, bins, relative=False): 276 284 """Standard histogram straight from the numeric manual
Note: See TracChangeset
for help on using the changeset viewer.