Manipulating values in Python =============================== One gives here some examples of manipulating values obtained previously in the form of lists or Numeric tables. Numeric is an optional Python module (i.e. not included in the Python distribution provided on www.python.org) but essential for using*Code_Aster*, so you can import Numeric on any *Code_Aster* installations. With Python lists ---------------------- Python lists are easily manipulated using loops. Let's take the example of the [:ref:`U2.51.01 `] notice for :math:`–10.`]). With Numeric boards ------------------------- The manipulation of data in the form of Numeric tables is simplified by the use of very powerful operations (called *ufunc*) on the entire array (in the following example we use sin ()). Numeric also manages multi-dimensional arrays. Continuing with the previous example: from Numeric import* lx = arrayrange (-10., 10.+0.2, 0.2, Float) ly = array (map (f, lx)) or without using f: ly = -1.5*less (sin (lx), 0.) + (-5.)* (1.-less (sin (lx), 0.)) Note that map () returns a list and not a Numeric array. The second expression is between 10 and 20 times faster on *very* large arrays (:math:`{10}^{5}` — :math:`{10}^{6}` terms), which is however not often the case with functions or tables from *Aster*. We can draw this curve using the keywords ABSCISSE and ORDONNEE of IMPR_FONCTION, taking care to convert Numeric tables into lists, for example (cf. [§ :ref:`4 `]): ABSCISSE = lx.toList () .. _Ref101086366: