On 2020-02-11 2:05 p.m., HOUSSEN Franck wrote:
OK, I understand this is a type related problem. I found a workaround (dummyTest3.py - init numpy arrays with list seems to work).

But, I unfortunately do not get how to change the code to get dummyTest2.py to work ?!... Should I read reinterpret_cast'ed data sizeof(double) by sizeof(double) : seems cryptic (?!), what's the natural way to do that ?

Can't you change your Python code so instead of

  np.append(lsFloat, 1.2)

you would call

  np.append(lsFloat, np.float32(1.2))

to make sure the casting happens before the broadcasting.

(Note: I haven't actually tried that; it just seems the natural fix to the issue ;-) )

Stefan

--

      ...ich hab' noch einen Koffer in Berlin...
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to