Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

convert string in list format to list python

>>> import ast
>>> x = '[ "A","B","C" , " D"]'
>>> x = ast.literal_eval(x)
>>> x
['A', 'B', 'C', ' D']
>>> x = [n.strip() for n in x]
>>> x
['A', 'B', 'C', 'D']
Comment

PREVIOUS NEXT
Code Example
Python :: Get List Into String 
Python :: find how many of each columns value pd 
Python :: split a given number in python 
Python :: python pandas remove non-numeric characters from multiple columns 
Python :: iterate over list and select 2 values together python 
Python :: scapy python import 
Python :: pynput.keyboard.Key 
Python :: how to use with open 
Python :: python replace all values in a column 
Python :: remove particular row number in pandas 
Python :: kaggle vs colab 
Python :: python dictionary get key by value 
Python :: reset django database 
Python :: falsy values in python 
Python :: how to pick out separate columns from the pandas dataframe object 
Python :: python numba 
Python :: replace character in column 
Python :: find closest color python 
Python :: python do something before exit 
Python :: how to add delay in python 
Python :: numpy drop duplicates 
Python :: flatten numpy array 
Python :: python ndim 
Python :: jupyter notebook add color text 
Python :: python currency signs 
Python :: 7zip python extract 
Python :: isnumeric python 
Python :: Python program to get the file size of a plain file. 
Python :: python correlation between features and target 
Python :: find an element in pandas 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =