Python
[已解決][Python] 使用 Numpy 判斷時報錯:ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
在使用 Numpy 格式的資料進行條件判斷時,有時我們會接收到以下報錯訊息:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Read More »[已解決][Python] 使用 Numpy 判斷時報錯:ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()[Python] 如何將 Numpy 資料格式轉成 Tuple 或 List
在 Python 中,若是說到陣列、多維度相關的資料處理,那想必無庸置疑地會想到 Numpy
,這是因為 Numpy
是一個使用了 C/C++ 和 Fortran 所構成的優化函式庫,運算效能是非常快的。
[已解決][Linux] 安裝 Python 出現錯誤訊息: zipimport.ZipImportError: can't decompress data
今天當我在 Linux 環境中安裝 Python 指定版本時,出現以下錯誤訊息:
Read More »[已解決][Linux] 安裝 Python 出現錯誤訊息: zipimport.ZipImportError: can't decompress data[已解決][Python] FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-build-8lcjii2e/PyQt5/setup.py'
今天我在新配置的環境中,使用 pip3 install PyQt5
指令安裝 Python 套件時,出現了以下報錯訊息:
[已解決][Python] ModuleNotFoundError: No module named 'distutils.util'
ModuleNotFoundError: No module named 'distutils.util'
Read More »[已解決][Python] ModuleNotFoundError: No module named 'distutils.util'[Python] 取數值小數點的方法(指定位數、四捨五入)
本來我經營個人網站,主要是寫我自己的學習的筆記,方便我日後自己查看。不過幾個禮拜前,我偶然被一個下班後想要精進、學習寫程式的朋友詢問了:我該如何取得數值的小數點?
Read More »[Python] 取數值小數點的方法(指定位數、四捨五入)[Python] 在程式碼中執行 AppleScript 語法
AppleScript 是在 MacOS 等作業系統上的一種腳本,可以很好地調用到在 MacOS 等作業系統上其他程式語言難以調用的功能。比方說:自定義一個應用程式視窗尺寸。
而在我透過 AppleScript 結合 MacOS 上的 Automator 工具製作快捷鍵功能後,我驚覺這些快捷鍵啟動的速度,其實非常非常地慢。
Read More »[Python] 在程式碼中執行 AppleScript 語法[Python] 3.10 先覽版本開始支援 switch 功能(透過 match 語法)
switch 是一種在眾多程式語言當中都有支援的語法,跟 if-else 功能很相似,不過跟設定任意條件的 if-else 不同,switch 更是針對單一條件的不同情況來執行程式碼,在許多時候比 if-else 來得更直覺。
Read More »[Python] 3.10 先覽版本開始支援 switch 功能(透過 match 語法)[WordPress] 使用 REST API 發表文章
最近比較多網友詢問了我關於如何透過程式在 WordPress 上發表文章,正好藉這次的機會,嘗試使用之前比較沒有研究的 REST API 來達到發表文章的目的。
Read More »[WordPress] 使用 REST API 發表文章