[已解決][Python] RecursionError: maximum recursion depth exceeded
問題描述
在 Python 中,為了防止 stack overflow(堆疊溢位,使用過多記憶體導致溢出),我們使用的遞迴是有層數限制的。一旦我們使用超過預設限制的遞迴深度,就會觸發以下的報錯:
Read More »[已解決][Python] RecursionError: maximum recursion depth exceeded在 Python 中,為了防止 stack overflow(堆疊溢位,使用過多記憶體導致溢出),我們使用的遞迴是有層數限制的。一旦我們使用超過預設限制的遞迴深度,就會觸發以下的報錯:
Read More »[已解決][Python] RecursionError: maximum recursion depth exceededTensorflow 可說是眾多深度學習框架當中最具知名度的(應該?),但是在我使用 Keras/Tensorflow 時,我經常會碰到以下這種關於 Numpy 版本的 FutureWarning:
Read More »[已解決] FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)])在撰寫程式的過程中,我們總難免會有著需要快速地、大量地將『許多變數賦值』的時候。也許是在一口氣製作許多界面元件的時候,也許是在一口氣進行許多數值設定的時候。
這種需求絕對是存在的,那麼在 Python 中該怎麼實現呢?
Read More »[Python] 使用 exec() 函式批量變數賦值最近,我手邊有越來越多的事情同時在進行,不論是寫投稿的論文、部落格、想寫的小說、想開發的 App、整理中的各個 Github 上的 side-project —— 多頭馬車的生活,讓我常常搞不清楚我現在到底該幹什麼。
Read More »[Python] 產生隨機亂數的 random 模組tarfile
是 Python 中的一個標準模組,可用於操作 gzip、bz2、lzma 等格式的壓縮、解壓縮 —— 若是以副檔名來分辨,那就是 tar.gz、tar.bz2、tar.xz 等三種副檔名格式的檔案,通通可以透過 Python 中的 tarfile
來操作。
想必大家都對所謂的『壓縮檔』不陌生吧?所謂的壓縮檔,就是我們將一個或多個檔案、資料夾壓縮成一份檔案,這也是所謂的『歸檔』。除了歸檔之外,依照壓縮格式演算法的不同,有些甚至能壓縮檔案的大小,幫助我們更好地儲存、傳送這些檔案。
Read More »[Python] 使用 zipfile 壓縮、解壓資料夾在 Python 中,很多人會在 ==
和 is
這兩種用法上混淆,實際上兩者之間的用法也是真的非常相似,比方說以下這樣的例子:
TF-IDF (Term Frequency - Inverse Document Frequency) 是在文字探勘、自然語言處理當中相當著名的一種文字加權方法,能夠反映出『詞彙』對於『文件』的重要性。跟著名的 Word2Vec 同樣能夠將文字轉換成向量,以供電腦進行計算。
Read More »[NLP] 文字探勘中的 TF-IDF 技術在使用 Python 進行後端程式開發時,我們經常會使用 argparse
來準備 Python 程式的輸入參數,再使用終端機執行一個 Shell Script 將各個程式串接起來,就好像 Pipeline 一樣。就在今天我在準備做這件事情的時候,突然間發現:
Python 存在著各式各樣的版本,在不同的版本當中,許多函式的功能也不太一樣 —— 最重要的是,許多重要的套件更是只在特定的版本上可以成功運行。
本篇文章便專門如何在 Linux 中下載不同的 Python 版本,並讓我們在系統中切換 Python 版本。
Read More »[Linux] 下載、安裝、切換系統中 Python 的版本