판다스 리스트 분리 도와주세요ㅠㅠ
조회수 217회
아래와 같이 .json 파일 데이터를 뽑은 상태이고
data=[]
with open(r'/Users/xxx/xxx.json', encoding='utf-8') as f:
for line in f:
data.append(line)
이렇게 변환된 파일을
[
'{
"id": "xx-data-00001",
"sentence_form": "깔끔하게 ... 금방 우러난다.",
"annotation":[["본품#편의성", ["부직포 포장", 5, 11], "positive"]],
}',
'{
"id": "xx-data-00002",
"sentence_form": "목욕할 때 ... 좋아졌다.",
"annotation": [["본품#일반", ["한약 냄새", 69, 75], "positive"]]}\n',
#...(중략)
},
]
데이터프레임 형식으로
sentence_form Emotion
0 "깔끔하게 ... 금방 우러난다." positive
1 "목욕할 때 ... 좋아졌다." positive
이렇게 전처리 하고 싶은데 하나의 리스트 안에 데이터가 복잡해서 어떤 방식으로 나누어야 하는지 감을 못잡겠어요...제발 도와주세요ㅠ
댓글 입력