[Mysql] python executemany ์‚ฌ์šฉ์‹œ TypeError: not all arguments converted during string ...
ยท
๐Ÿ›ข๏ธ Database
cursor.executemany(sql, data)๋กœ ๋‹ค์ˆ˜์˜ ๋กœ์šฐ ๋ฐ์ดํ„ฐ๋ฅผ INSERT ํ•  ์ˆ˜ ์žˆ๋‹ค. sql : INSERT ์ฟผ๋ฆฌ ๋ฌธ์„ ๋„ฃ์œผ๋ฉด ๋œ๋‹ค. sql = """INSERT INTO TBL_NAME (COL1_NAME, COL2_NAME, COL3_NAME) VALUES(%s,%s,%s)""" data : sql ์ž…๋ ฅ ํŒŒ๋ผ๋ฏธํ„ฐ๋“ค์„ tuple๋กœ ๋งŒ๋“ค๊ณ  list๋กœ ๊ฐ์‹ธ์ฃผ๋ฉด ๋œ๋‹ค. data = [(parm1,parm2,parm3),(parm1,parm2,parm3),(parm1,parm2,parm3)....] [ERROR] TypeError: not all arguments converted during string sql๋ฌธ์—์„œ ON DUPLICATE KEY UPDATE ์‚ฌ์šฉ์‹œ ์ฃผ์˜ [์ž˜๋ชป๋œ ๋ฐฉ์‹] s..
[Mysql] Python Sql query Format Error
ยท
๐Ÿ›ข๏ธ Database
#10.5.4 MySQLCursor.execute() Method cursor.execute(operation, params=None, multi=False) iterator = cursor.execute(operation, params=None, multi=True) This method executes the given database operation (query or command). The parameters found in the tuple or dictionary params are bound to the variables in the operation. Specify variables using %s or %(name)s parameter style (that is, using format..
[Mysql] Pymysql INSERT ์ฟผ๋ฆฌ ์ƒ์„ฑ๊ธฐ
ยท
๐Ÿ›ข๏ธ Database
def input_sql(data, input_table_name, pk=None): """ data: Input Data DataFrame input_table_name: Table name Str pk: Primary Key Name List """ colnames = list(data.columns) INPUT_NAME = '' for col in colnames: INPUT_NAME = INPUT_NAME + col.upper() +',' INPUT_NAME = INPUT_NAME[:-1] VALUES_INPUT = '' for col in colnames: VALUES_INPUT = VALUES_INPUT +'"%s",' VALUES_INPUT = VALUES_INPUT[:-1] sql = f"..
[Macbook pro m1] Help Note
ยท
๐Ÿ’ป Mac
๋งฅ๋ถ - Help 11.30 ๋งฅ๋ถ ํ”„๋กœ ๋„์ฐฉ VSCODE ์„ค์น˜ Tensor flow ์„ค์น˜ ๋ฐ ์—…๊ทธ๋ ˆ์ด๋“œ(https://developer.apple.com/metal/tensorflow-plugin/) ๋งฅ ๋‹จ์ถ•ํ‚ค ( https://support.apple.com/ko-kr/HT201236 ) Opt + com + esc ์ฐฝ ๊ฐ•์ œ ์ข…๋ฃŒ Com + tab + q Brew ์„ค์น˜ 12.01 12.02 ๋ฐ์Šคํฌํ†ฑ ์ „ํ™˜ ^+
[Code-Server] ์ฝ”๋“œ ์„œ๋ฒ„์—์„œ ์ฃผํ”ผํ„ฐ ๋…ธํŠธ๋ถ ์‚ฌ์šฉํ•˜๊ธฐ
ยท
๐Ÿ Python
pip install jupyter-vscode-server https://pypi.org/project/jupyter-vscode-server/ jupyter-vscode-server A Jupyter extension to launch VS Code pypi.org [Using Docker] ENV CODESERVER_URL="https://github.com/cdr/code-server/releases/download/1.1119-vsc1.33.1/code-server1.1119-vsc1.33.1-linux-x64.tar.gz" CODESERVER="code-server1.1119-vsc1.33.1-linux-x64" RUN wget ${CODESERVER_URL} && tar xvf ${CODES..
[Code-Server] import-im6.q16: unable to open X server ์—๋Ÿฌ
ยท
๐Ÿ Python
import matplotlib matplotlib.use('Agg") import matplotlib.pyplot as plt plt.plot() plt.savefig()...
๋‹คํ–ˆ๋‹ค
B's