Substitua os zeros em uma matriz inteira NumPy por nan

Eu escrevi um script python abaixo:

import numpy as np

arr = np.arange(6).reshape(2, 3)
arr[arr==0]=['nan']
print arr

Mas eu recebi este erro:

Traceback (most recent call last):
  File "C:\Users\Desktop\test.py", line 4, in <module>
    arr[arr==0]=['nan']
ValueError: invalid literal for long() with base 10: 'nan'
[Finished in 0.2s with exit code 1]

Como substituir zeros em uma matriz NumPy por nan?

questionAnswers(1)

yourAnswerToTheQuestion