輸入與輸出 (scipy.io)#

SciPy 有許多模組、類別和函式可用於從各種檔案格式讀取和寫入資料。

另請參閱

NumPy IO 常式

MATLAB® 檔案#

loadmat(file_name[, mdict, appendmat, spmatrix])

載入 MATLAB 檔案。

savemat(file_name, mdict[, appendmat, ...])

將名稱和陣列的字典儲存到 MATLAB 樣式的 .mat 檔案中。

whosmat(file_name[, appendmat])

列出 MATLAB 檔案內的變數。

對於低階 MATLAB 讀取和寫入工具,請參閱 scipy.io.matlab

IDL® 檔案#

readsav(file_name[, idict, python_dict, ...])

讀取 IDL .sav 檔案。

Matrix Market 檔案#

mminfo(source)

從類似檔案的 'source' Matrix Market 檔案中傳回大小和儲存參數。

mmread(source, *[, spmatrix])

將類似檔案的 'source' Matrix Market 檔案的內容讀取到矩陣中。

mmwrite(target, a[, comment, field, ...])

將稀疏或密集陣列 a 寫入類似檔案的 target Matrix Market 檔案。

未格式化的 Fortran 檔案#

FortranFile(filename[, mode, header_dtype])

用於 Fortran 程式碼的未格式化循序檔案的檔案物件。

FortranEOFError

表示檔案已正確結束。

FortranFormattingError

表示檔案在記錄中途結束。

Netcdf#

netcdf_file(filename[, mode, mmap, version, ...])

NetCDF 資料的檔案物件。

netcdf_variable(data, typecode, size, shape, ...)

netcdf 檔案的資料物件。

Harwell-Boeing 檔案#

hb_read(path_or_open_file, *[, spmatrix])

讀取 HB 格式檔案。

hb_write(path_or_open_file, m[, hb_info])

寫入 HB 格式檔案。

Wav 聲音檔案 (scipy.io.wavfile)#

read(filename[, mmap])

開啟 WAV 檔案。

write(filename, rate, data)

將 NumPy 陣列寫入為 WAV 檔案。

WavFileWarning

Arff 檔案 (scipy.io.arff)#

loadarff(f)

讀取 arff 檔案。

MetaData(rel, attr)

用於保存 ARFF 資料集有用資訊的小型容器。

ArffError

ParseArffError