Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python extract list from string

import ast
input = "[[1,2,3],['c',4,'r']]"
output = ast.literal_eval(input)
output
=> [[1, 2, 3], ['c', 4, 'r']]
Comment

extract list from string python

# Extract list from a str
import ast
input = "[[1,2,3],['c',4,'r']]"
output = ast.literal_eval(input)
output
=> [[1, 2, 3], ['c', 4, 'r']]
Comment

PREVIOUS NEXT
Code Example
Python :: where are python libraries installed ubuntu 
Python :: python inspect class 
Python :: python array sum 
Python :: sort one array based on another python 
Python :: create a pandas dataframe 
Python :: render() django 
Python :: python destructor 
Python :: python endless loop 
Python :: convert dictionary to string 
Python :: python call function in the same class 
Python :: class python example 
Python :: how to plot using matplotlib 
Python :: loop python 
Python :: convert spark dataframe to pandas 
Python :: .flatten() python 
Python :: gfg placement 
Python :: python list tutorial 
Python :: Python program to calculate area of a rectangle using function 
Python :: Python - How To Convert Bytearray to String 
Python :: a python string 
Python :: python code checker 
Python :: arithmetic operators in python 
Python :: django template filter 
Python :: opencv python rgb to hsv 
Python :: drop null values in dataframe 
Python :: what is gui in python 
Python :: autopy python not installing 
Python :: how to get spotify playlist id in spotipy 
Python :: print function python 
Python :: geometric progression in python 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =