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 :: python pandas table save 
Python :: .describe() python 
Python :: tweepy aut code 
Python :: python user input to tuple 
Python :: import class in python 
Python :: sum of 1 to even numbers in python 
Python :: draw box with mouse on image in canvas tkinter 
Python :: new column with multiple conditions 
Python :: get names of all file in a folder using python 
Python :: not equal to in django filter 
Python :: python remove many items via index at oncefrom a list? 
Python :: for python 
Python :: import all csv as append dataframes python 
Python :: opencv convert black pixels to white 
Python :: how to create new header of a dataframe in python 
Python :: python sum of list axes 
Python :: how to find unique values in list in python 
Python :: python powerpoint 
Python :: screen.onkey python 
Python :: convert pandas dataframe to dict with a column as key 
Python :: python3 lowercase 
Python :: tensorflow to numpy 
Python :: list comprehension python if else 
Python :: mse python 
Python :: python get array length 
Python :: xpath starts-with and ends-with 
Python :: tkinter icon 
Python :: split list in pd dataframe into rows 
Python :: lcm in python 
Python :: check if list elememnt in dataframe column 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =