발생: FeedDetailScreen 진도: Calendar 구현하기 도입 내용: Rendered more hooks than during the previous render v Previous render Next render ------------------------------------------------------ 1. useContext useContext 2. useContext useContext 3. useContext useContext 4. useEffect useEffect 5. useState useState .... 29. undefined useEffect ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in FeedDetailScreen (created by SceneView) useEffect의 위치에 따라 저런 에러가 발생하는데 왜 그런지 혹시 알 수 있을까요?? const { id } = route.params; ... const { } = useHooks; //! useEffect <<<<< 에러 발생 x if (isError || isPending) return null; //! 아래로 에러 발생 //! useEffec <<<< 에러 발생 handler 1 handler 2 return (View)
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 스케일링 진행 시 train 에는 있지만 test 에 컬럼이 없는 경우 "None of [Index(['Attrition_Flag'], dtype='object')] are in the [columns]" 의 오류가 발생합니다. 컬럼 리스트의 기준을 train으로 잡지 않고 중복되는 컬럼만 존재하는 test의 기준으로 컬럼 리스트를 잡고 fit_transform 을 진행해주어도 상관이 없을까요? from sklearn.preprocessing import RobustScaler rols = test.select_dtypes(exclude='object').columns for rol in rols: rs = RobustScaler() train[rol] = rs.fit_transform(train[[rol]]) test[rol] =rs.transform(test[[rol]]) 작성한 코드입니다.
orm.py 를 다음과 같이 작성했고 from sqlalchemy import Boolean, Column, Integer, String from sqlalchemy.orm import declarative_base Base = declarative_base() # base란 클래스로 db모델링 class ToDo(Base): __tablename__ = 'todo' # table이름 id = Column(Integer, primary_key=True, index=True) content = Column(String(256), nullable=False) is_done = Column(Boolean, nullable=False) # todo 객체의 출력을 쉽게 보기위해 repr def __repr__(self): return f'<ToDo(id={self.id}, content={self.content})>, is_done={self.is_done}' connection.py 도 다음과 같이 작성했으나 from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker DATABASE_URL = "mysql+pymysql://root:todos@127.0.0.1:3306/todos" engine = create_engine(DATABASE_URL, echo=True) # echo는 쿼리의 처리를 확인 SessionFactory = sessionmaker(autocommit=False, autoflush=False, bind=engine) 강의안에서 말씀하신대로 import까지 완료하고 명령어 session.scalars(select(ToDo)) 를 실행하는 과정에서 자꾸 이렇게 뜹니다 에러가 한두개가 아니라서 감도 안잡힙니다.. 도와주세요 2024-06-06 20:53:23,126 INFO sqlalchemy.engine.Engine SELECT todo.id , todo.content, todo.is _done FROM todo 2024-06-06 20:53:23,126 INFO sqlalchemy.engine.Engine [cached since 368.2s ago] {} Traceback (most recent call last): File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\engine\ base.py ", line 1967, in _exec_single_context self.dialect.do _execute( File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\engine\ default.py ", line 924, in do_execute cursor.execute(statement, parameters) File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ cursors.py ", line 153, in execute result = self._query(query) ^^^^^^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ cursors.py ", line 322, in _query conn.query(q) File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ connections.py ", line 563, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ connections.py ", line 825, in _read_query_result result.read () File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ connections.py ", line 1199, in read first_packet = self.connection._read_packet() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ connections.py ", line 775, in _read_packet packet.raise_for_error() File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ protocol.py ", line 219, in raise_for_error err.raise_mysql_exception(self._data) File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ err.py ", line 150, in raise_mysql_exception raise errorclass(errno, errval) pymysql.err.OperationalError: (1054, "Unknown column 'todo.content' in 'field list'") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm 2024.1.2\plugins\python\helpers\pydev\ pydevconsole.py ", line 364, in runcode coro = func() ^^^^^^ File "<input>", line 1, in <module> File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\orm\ session.py ", line 2459, in scalars return self._execute_internal( ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\orm\ session.py ", line 2236, in _execute_internal result: Result[Any] = compile_state_cls.orm_execute_statement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\orm\ context.py ", line 293, in orm_execute_statement result = conn.execute( ^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\engine\ base.py ", line 1418, in execute return meth( ^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\sql\ elements.py ", line 515, in _execute_on_connection return connection._execute_clauseelement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\engine\ base.py ", line 1640, in _execute_clauseelement ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\engine\ base.py ", line 1846, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\engine\ base.py ", line 1986, in _exec_single_context self._handle_dbapi_exception( File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\engine\ base.py ", line 2353, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\engine\ base.py ", line 1967, in _exec_single_context self.dialect.do _execute( File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\sqlalchemy\engine\ default.py ", line 924, in do_execute cursor.execute(statement, parameters) File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ cursors.py ", line 153, in execute result = self._query(query) ^^^^^^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ cursors.py ", line 322, in _query conn.query(q) File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ connections.py ", line 563, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ connections.py ", line 825, in _read_query_result result.read () File "C:\Users\yhkim\inflern_project\todos\Lib\site-packages\pymysql\ connections.py ", line 1199, in read first_packet = self.connection._read_packet() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
X_train['occupation'] = X_train['occupation'].fillna('X') X_train.isnull().sum() 안녕하세요 선생님, 좌측 x_train 에서 x_train[occ~]이 아닌 a = X_train['occupation'].fillna('X') 로 해서 진행해서 결측치로 채우는 방법은 어떻게 하는걸까요 ?? 좌측은 변수명인데 꼭 파일명['컬럼명']을 작성해야할까요 ?
❗ 질문 작성시 꼭 참고해주세요 최대한 상세히 현재 문제(또는 에러)와 코드(또는 github) 를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다. 맥/윈도우, 안드로이드/iOS, 버전 등의 개발환경 도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황 을 올려주세요! 맥 m1 pro입니다. 리액트 네이티브 버전은 강사님과 같이 진행하고 있습니다. 아이폰은 문제 없이 진행되는 반면 안드로이드가 작동되지 않아 질문올립니다. Warning: SDK processing. This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:installDebug'. > com.android.builder.testing.api.DeviceException: No connected devices! * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 14s info Run CLI with --verbose flag for more details.
안녕하세요 선생님, 수업질문드립니다~ 7회 기출유형(작업형3) 12:54 부분에서 pred = model.predict(test) 하면 1일 확률값이 나오는데요! 지난 작업형2에서 배울때 predict가 아닌 predict_proba를 할때 확률값이 나왔던걸로 기억합니다. 뭐가 다른 것인가요? 로지스틱 회귀모델은 확률값이 나오는건가요?