728x90
반응형
데이터프레임을 생성할때
ValueError: If using all scalar values, you must pass an index 에러 발생
df = pd.DataFrame({'number': 1,'No': 2})
dictionary 데이터를 데이터프레임으로 만들려고하는 경우 모든 값이 스칼라 값(if using all scalar values) 일때 에러발생
- 해결방법
1. 리스트 값을 입력
df = pd.DataFrame({'number': [1],'No': [2]})
2. 인덱스 값을 설정해줌
df = pd.DataFrame({'number': 1,'No': 2}, index=[0])
728x90
반응형
'에러해결 > PYTHON' 카테고리의 다른 글
selenium 크롤링 엑셀 다운로드가 안되는 현상 (0) | 2023.07.12 |
---|---|
pywintypes.com_error: (-2147221164, '클래스가 등록되지 않았습니다.', none, none) (1) | 2023.04.17 |
아나콘다 가상환경 'pip'는 내부 또는 외부 명령으로 인식되지 않습니다 (0) | 2023.04.11 |
주피터 노트북 500 : internal server error (1) | 2023.01.31 |
replace / str.replace 차이 (파이썬 replace 안됨) (0) | 2022.11.09 |