Inmutable numpy matriz?
¿Hay una forma sencilla de crear una matriz NumPy inmutable?
Si uno tiene que derivar una clase de ndarray
para hacer esto, ¿cuál es el conjunto mínimo de métodos que uno tiene que anular para lograr la inmutabilidad?
54
1 answers
Puede hacer que una matriz numpy no se escriba:
a = np.arange(10)
a.flags.writeable = False
a[0] = 1
# Gives: RuntimeError: array is not writeable
También vea la discusión en este hilo:
Http://mail.scipy.org/pipermail/numpy-discussion/2008-December/039274.html
Y la documentación:
Http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.flags.html
82
Author: JoshAdel,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-04-04 16:36:18
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-04-04 16:36:18