First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

boolean with numpy

Hello! Please explain me why

numpy.array([1/5])[0] == 0.2

is False but

np.array([1/5.])[0] == 0.2

is True. What should I do to get true at first line of code?
Thanks a lot.

click to hide/show revision 2
No.2 Revision

boolean with numpy

Hello! Please explain me why

numpy.array([1/5])[0] == 0.2

is False but

np.array([1/5.])[0] == 0.2

is True. At 2nd line of code there is point after 5.
What should I do to get true at first line of code?
Thanks a lot.

click to hide/show revision 3
np --> numpy

boolean with numpy

Hello! Please explain me why

numpy.array([1/5])[0] == 0.2

is False but

np.array([1/5.])[0] numpy.array([1/5.])[0] == 0.2

is True. At 2nd line of code there is point after 5.
What should I do to get true at first line of code?
Thanks a lot.

boolean with numpy

Hello! Please explain me why

numpy.array([1/5])[0] == 0.2

is False but

numpy.array([1/5.])[0] == 0.2

is True. At 2nd line of code there is point after 5.
What should I do to get true at first line of code?
Thanks a lot.

boolean with numpy

Hello! Please explain me why

numpy.array([1/5])[0] == 0.2

is False but

numpy.array([1/5.])[0] == 0.2

is True. At 2nd line of code there is point after 5.
What should I do to get true at first line of code?
Thanks a lot.