이야기를 나눠요
143만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
Amplitude(앰플리튜드)로 마케팅 데이터 분석 하는 방법
최신 영상하나 더 내주시면 좋을것 같아요 ㅜㅜ
옛날 영상이라 화면 인터페이스가 달라서 눌러보면서 학습하고 싶은데 아쉬운것 같아요
-
다양한 사례로 익히는 SQL 데이터 분석
버전을 맞추었는데도 오류가 발생합니다. (pd ver: 2.0.3, sqlalchemy: 2.0.0)
query = """ select * from nw.customers """ df = pd.read_sql_query(sql=query, con=postgres_engine) df.head(10) --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) Cell In[25], line 4 1 query = """ 2 select * from nw.customers 3 """ ----> 4 df = pd.read_sql_query(sql=query, con=postgres_engine) 5 df.head(10) File ~\anaconda3\Lib\site-packages\pandas\io\sql.py:468, in read_sql_query(sql, con, index_col, coerce_float, params, parse_dates, chunksize, dtype, dtype_backend) 465 if dtype_backend is lib.no_default: 466 dtype_backend = "numpy" # type: ignore[assignment] --> 468 with pandasSQL_builder(con) as pandas_sql: 469 return pandas_sql.read_query( 470 sql, 471 index_col=index_col, (...) 477 dtype_backend=dtype_backend, 478 ) File ~\anaconda3\Lib\site-packages\pandas\io\sql.py:832, in pandasSQL_builder(con, schema, need_transaction) 829 raise ImportError("Using URI string without sqlalchemy installed.") 831 if sqlalchemy is not None and isinstance(con, (str, sqlalchemy.engine.Connectable)): --> 832 return SQLDatabase(con, schema, need_transaction) 834 warnings.warn( 835 "pandas only supports SQLAlchemy connectable (engine/connection) or " 836 "database string URI or sqlite3 DBAPI2 connection. Other DBAPI2 " (...) 839 stacklevel=find_stack_level(), 840 ) 841 return SQLiteDatabase(con) File ~\anaconda3\Lib\site-packages\pandas\io\sql.py:1539, in SQLDatabase.__init__(self, con, schema, need_transaction) 1537 self.exit_stack.callback(con.dispose) 1538 if isinstance(con, Engine): -> 1539 con = self.exit_stack.enter_context(con.connect()) 1540 if need_transaction and not con.in_transaction(): 1541 self.exit_stack.enter_context(con.begin()) File ~\anaconda3\Lib\site-packages\sqlalchemy\engine\base.py:3245, in Engine.connect(self) 3222 def connect(self) -> Connection: 3223 """Return a new :class:`_engine.Connection` object. 3224 3225 The :class:`_engine.Connection` acts as a Python context manager, so (...) 3242 3243 """ -> 3245 return self._connection_cls(self) File ~\anaconda3\Lib\site-packages\sqlalchemy\engine\base.py:145, in Connection.__init__(self, engine, connection, _has_events, _allow_revalidate, _allow_autobegin) 143 if connection is None: 144 try: --> 145 self._dbapi_connection = engine.raw_connection() 146 except dialect.loaded_dbapi.Error as err: 147 Connection._handle_dbapi_exception_noconnection( 148 err, dialect, engine 149 ) File ~\anaconda3\Lib\site-packages\sqlalchemy\engine\base.py:3269, in Engine.raw_connection(self) 3247 def raw_connection(self) -> PoolProxiedConnection: 3248 """Return a "raw" DBAPI connection from the connection pool. 3249 3250 The returned object is a proxied version of the DBAPI (...) 3267 3268 """ -> 3269 return self.pool.connect() File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:452, in Pool.connect(self) 444 def connect(self) -> PoolProxiedConnection: 445 """Return a DBAPI connection from the pool. 446 447 The connection is instrumented such that when its (...) 450 451 """ --> 452 return _ConnectionFairy._checkout(self) File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:1255, in _ConnectionFairy._checkout(cls, pool, threadconns, fairy) 1247 @classmethod 1248 def _checkout( 1249 cls, (...) 1252 fairy: Optional[_ConnectionFairy] = None, 1253 ) -> _ConnectionFairy: 1254 if not fairy: -> 1255 fairy = _ConnectionRecord.checkout(pool) 1257 if threadconns is not None: 1258 threadconns.current = weakref.ref(fairy) File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:716, in _ConnectionRecord.checkout(cls, pool) 714 rec = cast(_ConnectionRecord, pool._do_get()) 715 else: --> 716 rec = pool._do_get() 718 try: 719 dbapi_connection = rec.get_connection() File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\impl.py:168, in QueuePool._do_get(self) 166 return self._create_connection() 167 except: --> 168 with util.safe_reraise(): 169 self._dec_overflow() 170 raise File ~\anaconda3\Lib\site-packages\sqlalchemy\util\langhelpers.py:147, in safe_reraise.__exit__(self, type_, value, traceback) 145 assert exc_value is not None 146 self._exc_info = None # remove potential circular references --> 147 raise exc_value.with_traceback(exc_tb) 148 else: 149 self._exc_info = None # remove potential circular references File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\impl.py:166, in QueuePool._do_get(self) 164 if self._inc_overflow(): 165 try: --> 166 return self._create_connection() 167 except: 168 with util.safe_reraise(): File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:393, in Pool._create_connection(self) 390 def _create_connection(self) -> ConnectionPoolEntry: 391 """Called by subclasses to create a new ConnectionRecord.""" --> 393 return _ConnectionRecord(self) File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:678, in _ConnectionRecord.__init__(self, pool, connect) 676 self.__pool = pool 677 if connect: --> 678 self.__connect() 679 self.finalize_callback = deque() File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:902, in _ConnectionRecord.__connect(self) 900 self.fresh = True 901 except BaseException as e: --> 902 with util.safe_reraise(): 903 pool.logger.debug("Error on connect(): %s", e) 904 else: 905 # in SQLAlchemy 1.4 the first_connect event is not used by 906 # the engine, so this will usually not be set File ~\anaconda3\Lib\site-packages\sqlalchemy\util\langhelpers.py:147, in safe_reraise.__exit__(self, type_, value, traceback) 145 assert exc_value is not None 146 self._exc_info = None # remove potential circular references --> 147 raise exc_value.with_traceback(exc_tb) 148 else: 149 self._exc_info = None # remove potential circular references File ~\anaconda3\Lib\site-packages\sqlalchemy\pool\base.py:898, in _ConnectionRecord.__connect(self) 896 try: 897 self.starttime = time.time() --> 898 self.dbapi_connection = connection = pool._invoke_creator(self) 899 pool.logger.debug("Created new connection %r", connection) 900 self.fresh = True File ~\anaconda3\Lib\site-packages\sqlalchemy\engine\create.py:640, in create_engine.<locals>.connect(connection_record) 638 if connection is not None: 639 return connection --> 640 return dialect.connect(*cargs, **cparams) File ~\anaconda3\Lib\site-packages\sqlalchemy\engine\default.py:580, in DefaultDialect.connect(self, *cargs, **cparams) 578 def connect(self, *cargs, **cparams): 579 # inherits the docstring from interfaces.Dialect.connect --> 580 return self.loaded_dbapi.connect(*cargs, **cparams) File ~\anaconda3\Lib\site-packages\psycopg2\__init__.py:122, in connect(dsn, connection_factory, cursor_factory, **kwargs) 119 kwasync['async_'] = kwargs.pop('async_') 121 dsn = _ext.make_dsn(dsn, **kwargs) --> 122 conn = _connect(dsn, connection_factory=connection_factory, **kwasync) 123 if cursor_factory is not None: 124 conn.cursor_factory = cursor_factory UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position 63: invalid start byte 판다스 버전과 sqlalchemy 버전은 다음과 같이 맞추었습니다2.0.3 2.0.0
-
GA4 필수 코스 (by 현직 실리콘밸리 마케팅 디렉터)
하... 이거 테스트 사이트는 만들어 주셨어야죠 ㅠ
수강생들 전부가 각자 사이트 가지고서 하는 것도 아닌데, 테스트 용도로 사이트를 만들어주시질 않았네요.. 하...
-
GA4 필수 코스 (by 현직 실리콘밸리 마케팅 디렉터)
응용프로그램도 ga 분석이 가능할까요?
안녕하세요 c#으로 윈도우 전용 응용프로그램을 만드려합니다. cta나 유입 분석이 응용프로그램에서도 ga로 가능한지 가능하다면 sdk로 처리해야하는건지 방법 문의드립니다
-
다양한 사례로 익히는 SQL 데이터 분석
나래비는 일본어 입니다..
선생님.. 나래비는 일본어 입니다. 어감이 예뻐서 옛 우리말인줄 알고 찾아봤는데 '줄을 세우다'라는 일본어 '나라비'가 어원이라고 하네요