Skip to main content

idx2numpy

Build Status

idx2numpy package provides a tool for converting files to and from IDX format to numpy.ndarray. You can meet files in IDX format, e.g. when you're going to read the MNIST database of handwritten digits provided by Yann LeCun.

The description of IDX format also can be found on this page.

Installation

The easiest way to install is by using pip to pull it from PyPI:

pip install idx2numpy

You can also clone the Git repository from Github and install the package manually:

git clone https://github.com/ivanyu/idx2numpy.git
python setup.py install

Usage

import idx2numpy

# Reading
ndarr = idx2numpy.convert_from_file('myfile.idx')

f_read = open('myfile.idx', 'rb')
ndarr = idx2numpy.convert_from_file(f_read)

s = f_read.read()
ndarr = idx2numpy.convert_from_string(s)

# Writing    
idx2numpy.convert_to_file('myfile_copy.idx', ndarr)

f_write = open('myfile_copy2.idx', 'wb')
idx2numpy.convert_to_file(f_write, ndarr)

s = convert_to_string(ndarr)

License

MIT license (see LICENSE file)

Metadata

Release files for idx2numpy 1.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for idx2numpy 1.2.3
File Size Uploaded
idx2numpy-1.2.3.tar.gz 6.8 kB Details

Release files / idx2numpy-1.2.3.tar.gz

Download URL idx2numpy-1.2.3.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
559b578a8f69a41af54cf15c8dfc43ab9f380e0a7d602a84bdabaf52acfbbd3e
BLAKE2b-256 checksum
How to use checksums
7e6b80628f6cc2f44d80b27f1ef7b57b257ed4c73766113b77d13ad110c091b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

Release history Release notifications | RSS feed

This release

1.2.3 This release

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page