All Projects → ivanyu → idx2numpy

ivanyu / idx2numpy

Licence: MIT license
A Python package which provides tools to convert files to and from IDX format (described at http://yann.lecun.com/exdb/mnist/) into numpy.ndarray.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to idx2numpy

h3ron
Rust crates for the H3 geospatial indexing system
Stars: ✭ 52 (+136.36%)
Mutual labels:  ndarray
Numjs
Like NumPy, in JavaScript
Stars: ✭ 1,912 (+8590.91%)
Mutual labels:  ndarray
ndarray-vision
Computer vision library built on top of ndarray
Stars: ✭ 42 (+90.91%)
Mutual labels:  ndarray
NDScala
N-dimensional arrays in Scala 3. Think NumPy ndarray, but type-safe over shapes, array/axis labels & numeric data types
Stars: ✭ 37 (+68.18%)
Mutual labels:  ndarray
xtensor-r
R bindings for xtensor
Stars: ✭ 83 (+277.27%)
Mutual labels:  ndarray
numphp
PHP tools for matrix computation
Stars: ✭ 25 (+13.64%)
Mutual labels:  ndarray

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)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].