커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
3주차 과제 질문
undefined주차
북마크
서*헌
댓글
3
추천
0
조회수
25
조회수
25
답변 완료

3주차 과제하는데 강의자료 코드를 그대로 사용하는데 오류가 뜹니다ㅜ




스파르타 즉문즉답





작성한 코드 및 에러 메세지

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-7-2ac158428019> in <cell line: 6>()
      4 
      5 format='%Y-%m-%dT%H:%M:%S.%f'
----> 6 sparta_data['done_date_time'] = pd.to_datetime(sparta_data['done_date'], format=format)
      7 sparta_data.tail(5)
      8 


2 frames

/usr/local/lib/python3.10/dist-packages/pandas/core/tools/datetimes.py in _array_strptime_with_fallback(arg, name, utc, fmt, exact, errors)
    465     Call array_strptime, with fallback behavior depending on 'errors'.
    466     """
--> 467     result, tz_out = array_strptime(arg, fmt, exact=exact, errors=errors, utc=utc)
    468     if tz_out is not None:
    469         unit = np.datetime_data(result.dtype)[0]

strptime.pyx in pandas._libs.tslibs.strptime.array_strptime()

strptime.pyx in pandas._libs.tslibs.strptime.array_strptime()

strptime.pyx in pandas._libs.tslibs.strptime._parse_with_format()

ValueError: time data "2020-08-07 12:02:16" doesn't match format "%Y-%m-%dT%H:%M:%S.%f", at position 0. You might want to try:
    - passing `format` if your strings have a consistent format;
    - passing `format='ISO8601'` if your strings are all ISO8601 but not necessarily in exactly the same format;

- passing `format='mixed'`, and the format will be inferred for each element individually. You might want to use `dayfirst` alongside this.



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴