Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Numpy "SyntaxError: invalid decimal literal"

So i’m trying to do some math on this vector in numpy but defining it just yields an error.

I tried defining the vector like this:
vert = np.array([1.7, 0.7782, -0.4158,1.0])
and it errored like this:

vert = vert = np.array([1.7, 0.7782, -0.4158,1.0])
                                           ^
SyntaxError: invalid decimal literal

I tried removing the negative sign but it still had that error.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You’ve used U+65292 (Fullwidth Comma) at the end of the decimal instead the expected comma symbol. Python is parsing that symbol as a part of the number. Comapre the following two lines:

vert = vert = np.array([1.7, 0.7782, -0.4158,1.0])
vert = vert = np.array([1.7, 0.7782, -0.4158,1.0])
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading