Python
JupyterLabの標準フォントだと全角文字、半角文字が判別できないです。特にスペースは絶望的です。 見やすいフォントに変更しましょう。 おすすめは'Ricty Diminished'です。 (標準ではインストールされていないフォントですので、こちらにアクセスし、「Ri…
JupyterLabで作成したプログラムを.pyに変換して実行すると、webdriver.Chrome()のところで下記のエラーが出ました。... FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver' ... selenium.common.exceptions.WebDriverException: Mess…
基本型 spam = ['cat', 'bat', 'rat', 'elephant'] spam[1] -> ‘bat’ 多次元 spam = [['cat', 'bat'], [10, 20, 30, 40, 50]] spam[0] -> ['cat', 'bat'] spam[1][4] -> 50 ■後ろからの参照 spam = ['cat', 'bat', 'rat', 'elephant'] spam[-2] -> 'rat' spa…
Windowsのpythonでprint関数を使用すると、 UnicodeEncodeError: 'cp932' codec can't encode character が発生することがあります。理由と対処法を以下に記します。 Pythonでは文字列はUTF-8で処理されます。一方、Windowsでは標準出力へはCP932(シフトJIS…
オフライン環境上でPyInstallerの導入に手こずったので対処方法を記録しておきます。 ■ pyinstallerが実行できない pip install --no-deps pyinstaller-4.9-py3-none-win_amd64.whl としてpyinstallerをインストールします。 ところが、コマンドプロンプトか…
Variable InspectorはJupyter Labで変数の中身が確認できる拡張機能です。インストール中にエラーが出た際の対処方法をメモします。 インストール手順 >jupyter labextension install @lckr/jupyterlab_variableinspector →エラーになりました。RuntimeError…
import urllib.request as requrl = ページアドレスresponse = req.urlopen(url)とするとSSLCertVerificationErrorが出ました。以下を追加すると解決します。 import sslssl._create_default_https_context = ssl._create_unverified_context