[NumPy-Tickets] [NumPy] #1218: There should be a way to format individual entries in array2string

NumPy Trac numpy-tickets@scipy....
Sat Apr 2 19:03:15 CDT 2011


#1218: There should be a way to format individual entries in array2string
-------------------------------+--------------------------------------------
  Reporter:  AndreasKloeckner  |       Owner:  somebody   
      Type:  enhancement       |      Status:  reopened   
  Priority:  low               |   Milestone:  Unscheduled
 Component:  numpy.core        |     Version:  devel      
Resolution:                    |    Keywords:             
-------------------------------+--------------------------------------------

Comment(by AndreasKloeckner):

 For example:

 {{{
 def format_function(x):
   if abs(x) < 1: return '.'
   elif abs(x) < 2: return 'o'
   else return 'O'
 }}}

 or

 {{{
 def format_function(x):
   return "%.4f" % x
 }}}

 or

 {{{
 def format_function(x):
   return hex(x)
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1218#comment:8>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list