string array to float array python

Do you want to know the information about “string array to float array python”. If yes, you’re in the correct article.

string array to float array python

import numpy as np
x = np.array(['1.1', '2.2', '3.3'])
y = x.astype(np.float)
print(y) # Output : [1.1, 2.2, 3.3]
import numpy as np
x = np.array(['1.1', '2.2', '3.3'])
y = x.astype(np.float)

Final Thoughts

I hope this article helps you to know about “string array to float array python”. If you have any queries regarding this tutorial please let us know via the comment section. Share this post with your friends and family via social networks.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coder Diksha. Here, I post about programming to help developers.

Share on:

Leave a Comment