array를 pandas dataframe으로 변형할때 관련해서 질문합니다.
조회수 774회
RCNN을 이용해 이미지를 분류하고, 결과값을 array로 받았습니다.
import pandas as pd
import collections
x=r['class_ids']
pic_before=collections.Counter(x)
pic_before
out : Counter({17: 2})
y=r1['class_ids']
pic_after=collections.Counter(y)
pic_after
out : Counter({17: 2})
mydict = { '이전 사진':pic_before, '다음 사진' : pic_after, '일치 여부':z}
dict_df = pd.DataFrame({key:pd.Series(value) for key, value in mydict.items()})
dict_df
array 배열이 (2, )으로 되어서 두 줄로 데이터프레임이 만들어지는데, 어떻게하면 array를 (1, )로 만들어서 한줄씩 write 할 수 있을까요? pic_before=collections.Counter(x)의 아웃풋인 Counter({17: 2})에서 17과 2를 따로 빼낼 수 있을까요?
답변해주시면 감사하겠습니다!
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력