key error = ',' 질의
작업형2 기출 5,6회를 풀던 중 동일 에러 발생으로 사유를 알 수 없어 질의드립니다.
데이터 불러오고 확인하는 과정에서 train.head() or test.head() 를 쓰면
key error = ',' 발생합니다. 저는 명령문에 , 를 사용한 적은 없구요..
# 데이터 불러오기
import pandas as pd
pd.set_option('display.max_columns',None)
pd.set_option('display.float_format','{,:10f}'.format)
train = pd.read_csv("train.csv")
test = pd.read_csv("test.csv")
#train.shape # 3759,9
#test.shape # 1617,8
#train.info() # model,transmission,fuelType - object
#test.info()
#train.describe()
#test.describe()
#train.isnull().sum() # 결측치 없음
#test.isnull().sum()
# train[''] = train[''].fillna()
train.head() -> 여기서부터 에러 발생
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/IPython/core/formatters.py in __call__(self, obj)
700 type_pprinters=self.type_printers,
701 deferred_pprinters=self.deferred_printers)
--> 702 printer.pretty(obj)
703 printer.flush()
704 return stream.getvalue()
16 frames
/usr/local/lib/python3.10/dist-packages/pandas/io/formats/format.py in <listcomp>(.0)
1514 formatted = np.array(
1515 [
-> 1516 formatter(val) if not m else na_rep
1517 for val, m in zip(values.ravel(), mask.ravel())
1518 ]
KeyError: ','답변 1
0
# 에러 코드
pd.set_option('display.float_format','{,:10f}'.format)
# 수정 코드
pd.set_option('display.float_format', '{:,.10f}'.format)화이팅 💪
출력값 질문
0
9
1
수업노트가 어디에 있나요?
0
19
1
실기시험 제출관련
0
152
2
6.20 작업형 2 과적합
0
157
3
코딩팡 장업형2 베이스 라인 인코딩 종류 질문
0
49
2
로지스틱회귀, 회귀
0
48
2
회귀 문제를 풀때 질문입니다.
0
55
1
불균형 처리 후 성능이 더 낮아졌다면,
0
61
2
실기 체험 제2유형 에러 문의
0
61
1
LIGHTGBM 으로 하면 pred값이 소수점 6자리까지 나오는게 맞나요
0
50
2
3번문제 등분산 가정
0
48
2
작업형3 target 형 변환 질문
0
35
2
[작업형1] 연습문제 섹션1 ~ 10 의 section4
0
36
3
원핫인코딩과 레이블 인코딩에서 concat
0
59
2
제2유형 질문입니다.
0
46
2
C()
0
44
2
작업형 2에서 strafity 적용 유무
0
52
2
수강 기간 연장 가능 여부 문의드립니다.
0
61
1
ols
0
43
2
2유형 작성관련 질문(일반 심화)
0
39
2
2유형 작성관련 질문
0
41
2
2유형 object컬럼 개수 다르면
0
48
2
코딩팡질문이요ㅠㅠ
0
45
2
관찰값과 기대값의 개념이 헷갈립니다.
0
25
2





