Skip to content

Instantly share code, notes, and snippets.

View drjerry's full-sized avatar

Jerry Gagelman drjerry

View GitHub Profile
NR == 1 {sep=""}
NR > 2 {sep=","}
{
if (NR == 1) {
split($0, tags);
if (EC == "") EC = "\"";
}
else {
split($0, vals);
jrec = sep"{";
@tylerneylon
tylerneylon / mnist.py
Last active April 30, 2022 06:48
A function to load numpy arrays from the MNIST data files.
""" A function that can read MNIST's idx file format into numpy arrays.
The MNIST data files can be downloaded from here:
http://yann.lecun.com/exdb/mnist/
This relies on the fact that the MNIST dataset consistently uses
unsigned char types with their data segments.
"""