You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

idx2numpy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idx2numpy

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.

1.2.3
pipPyPI
Maintainers
1

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)

Keywords

mnist numpy

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts