logo-MindMajix
PostPythonPython
T
Tim Parker

Posted on 26th July 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"]'

1 answers
Answers
P
persis crystal

Posted on 26th July 2024| views

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
Name
Course *
Email *
Phone Number