728x90 TypeError3 TypeError: sub_process() takes 1 positional argument but 11 were given 멀티 프로세싱 관련, 초기 작업 중 발생한 error 코드는 아래와 같다. # 메인 프로세스 if __name__ == "__main__": print("[main] start") p = mp.Process(target=sub_process, args=("startcoding")) p.start() print("[main] end") error 수정 코드는 아래와 같다. # 메인 프로세스 if __name__ == "__main__": print("[main] start") p = mp.Process(target=sub_process, args=("startcoding",)) p.start() print("[main] end") 차이점은 mp.Process 내 args (튜플 형태) 설정 시 1개만 부여.. Python 2024. 1. 25. [Jupyter Notebook] TypeError: 'method' object is not subscriptable 마주하게 된 오류 메시지이다. --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In [53], line 1 ----> 1 sum_of_students_by_class = sum_of_students_by_class.drop['user_id'] 2 sum_of_students_by_class TypeError: 'method' object is not subscriptable 그리고 상기 오류를 유발한 코드 위치가 오류 메시지에 보면 1행이라고 나와 있다. 이에 대한 오류를 잡은 정상 코드는 다음과 같다. sum_of_students.. Python 2022. 12. 9. [Jupyter Notebook] TypeError: barplot() got multiple values for argument 'data' 아래는 제목의 오류를 가져오게 한 코드와 오류 내용이다. #그래프 크기 설정 plt.figure(figsize = (14, 5)) # 바 그래프 그리기 (x축 = Age_cat, y축 = Survived) sns.barplot('Age_cat', 'Survived', data = titanic) # 그래프 나타내기 plt.show() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In [37], line 5 2 plt.figure(figsize = (14, 5)) 4 # 바 그래프 그리기 (x축 = Age_cat, y축 = Sur.. Python 2022. 12. 6. 이전 1 다음 💲 추천 글 반응형 SMALL