Post

PythonPython

T
Tim Parker

Posted on 4th March 2024|11 views

0
votes

String To Array Python

How can I convert a string to an array in python?

Is there any way to convert this following string into an array here I am dealing with the string '["hi", "welcome", "to", "mindmajix"]'

Answers
P
persis crystal

Posted on 4th March 2024

import numpy as nup 

x=nup.array([‘hi’, ‘welcome’, ‘to’, ‘mindmajix’]) 

print x # ['hi' 'welcome' 'to' 'mindmajix']

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos