지방이의 Data Science Lab

[python] string 을 list로 변환 본문

Data Analysis/Python

[python] string 을 list로 변환

[지현] 2020. 2. 13. 14:56

cv_id['train'][0] ==> '1,10,100'

 

cv_id['train'][0].split(",") ==>'1', '10', '100'

 

train0 = [int(i) for i in cv_id['train'][0].split(",")]   ==>[1, 10,100]

Comments