teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

リファレンス追加

2020/12/21 03:38

投稿

bsdfan
bsdfan

スコア4921

answer CHANGED
@@ -8,5 +8,6 @@
8
8
  conn.text_factory = lambda x: x.decode('sjis')
9
9
  df = pd.read_sql_query('SELECT * FROM tablename', conn)
10
10
  ```
11
+ 参考:[https://docs.python.org/ja/3/library/sqlite3.html#sqlite3.Connection.text_factory](https://docs.python.org/ja/3/library/sqlite3.html#sqlite3.Connection.text_factory)
11
12
 
12
13
  ただし、できるなら、データベースに保存する文字コードをUTF-8にすることをおすすめします。