[numpy]Input and output

NumPy binary files (NPY, NPZ)

load(file[, mmap_mode, allow_pickle, ...])

Load arrays or pickled objects from .npy, .npz or pickled files.

save(file, arr[, allow_pickle, fix_imports])

Save an array to a binary file in NumPy .npy format.

savez(file, *args, **kwds)

Save several arrays into a single file in uncompressed .npz format.

savez_compressed(file, *args, **kwds)

Save several arrays into a single file in compressed .npz format.

The format of these binary file types is documented in numpy.lib.format

Text files

loadtxt(fname[, dtype, comments, delimiter, ...])

Load data from a text file.

savetxt(fname, X[, fmt, delimiter, newline, ...])

Save an array to a text file.

genfromtxt(fname[, dtype, comments, ...])

Load data from a text file, with missing values handled as specified.

fromregex(file, regexp, dtype[, encoding])

Construct an array from a text file, using regular expression parsing.

fromstring(string[, dtype, count, like])

A new 1-D array initialized from text data in a string.

ndarray.tofile(fid[, sep, format])

Write array to a file as text or binary (default).

ndarray.tolist()

Return the array as an a.ndim-levels deep nested list of Python scalars.

Raw binary files

fromfile(file[, dtype, count, sep, offset, like])

Construct an array from data in a text or binary file.

ndarray.tofile(fid[, sep, format])

Write array to a file as text or binary (default).

String formatting

array2string(a[, max_line_width, precision, ...])

Return a string representation of an array.

array_repr(arr[, max_line_width, precision, ...])

Return the string representation of an array.

array_str(a[, max_line_width, precision, ...])

Return a string representation of the data in an array.

format_float_positional(x[, precision, ...])

Format a floating-point scalar as a decimal string in positional notation.

format_float_scientific(x[, precision, ...])

Format a floating-point scalar as a decimal string in scientific notation.

Memory mapping files

memmap(filename[, dtype, mode, offset, ...])

Create a memory-map to an array stored in a binary file on disk.

lib.format.open_memmap(filename[, mode, ...])

Open a .npy file as a memory-mapped array.

Text formatting options

set_printoptions([precision, threshold, ...])

Set printing options.

get_printoptions()

Return the current print options.

set_string_function(f[, repr])

Set a Python function to be used when pretty printing arrays.

printoptions(*args, **kwargs)

Context manager for setting print options.

Base-n representations

binary_repr(num[, width])

Return the binary representation of the input number as a string.

base_repr(number[, base, padding])

Return a string representation of a number in the given base system.

Data sources

DataSource([destpath])

A generic data source file (file, http, ftp, ...).

Binary Format Description

lib.format

Binary serialization

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值