Skip to main content

Provides a convenient way to append numpy arrays to a file.

Project description

Provides a convenient way to append numpy arrays to a file.

The NpendWriter and NpendReader classes are used to write and read numpy arrays respectively.

Requirements

  • numpy
  • sip

Usage

    #! -*- coding:utf-8 -*-
    from npend import NpendWriter, NpendReader
    import numpy as np
    if __name__=="__main__":
        filePath="test.npd"
        nw=NpendWriter(filePath)
        arr=np.random.random((34,5,6))# Write an array that has three dimensions.
        nw.append(arr)# Keep the size of the last two dimensions the same as the data written before.
        arr=np.random.random((10,5,6))
        nw.append(arr)
        arr=np.random.random((5,6))# Write an array with two dimensions.
        nw.append(arr)
        nw.close()
        nr=NpendReader(filePath)
        arr=nr.read()# Load numpy array from file.
        print(arr.shape,arr.dtype)
	

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

npend-1.0.1.tar.gz (11.3 kB view hashes)

Uploaded Source

Built Distribution

npend-1.0.1-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page