반응형
다음과 같은 사전을 반환하는 함수가 있습니다.
{'truth': 185.179993, 'day1': 197.22307753038834, 'day2': 197.26118010160317, 'day3': 197.19846975345905, 'day4': 197.1490578795196, 'day5': 197.37179265011116}
이 사전을 다음과 같이 데이터 프레임에 추가하려고합니다.
output = pd.DataFrame()
output.append(dictionary, ignore_index=True)
print(output.head())
불행히도 데이터 프레임을 인쇄하면 빈 데이터 프레임이 생성됩니다. 어떤 아이디어?
해결 방법
결과에 값을 할당하지 않습니다.
output = pd.DataFrame()
output = output.append(dictionary, ignore_index=True)
print(output.head())
참조 페이지 https://stackoverflow.com/questions/51774826
반응형
'파이썬' 카테고리의 다른 글
파이썬 Python을 PHP 및 JSP와 같은 HTML에 포함 할 수 있습니까? (0) | 2020.10.08 |
---|---|
파이썬 How do I write output in same place on the console? (0) | 2020.10.08 |
파이썬 Python에서 Numpy Matrix에서 목록을 만드는 방법 (0) | 2020.10.08 |
파이썬 Django Model Field 객체의 값을 얻는 방법 (0) | 2020.10.08 |
파이썬 TypeError : 'float32'유형의 개체가 JSON 직렬화 가능하지 않습니다. (0) | 2020.10.08 |
댓글