0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,
})
}
+
+ f, err = os.Open(npydir + "/onehot-columns.npy")
+ c.Assert(err, check.IsNil)
+ defer f.Close()
+ npy, err = gonpy.NewReader(f)
+ c.Assert(err, check.IsNil)
+ c.Check(npy.Shape, check.DeepEquals, []int{8, 5})
+ onehotcols, err := npy.GetInt32()
+ if c.Check(err, check.IsNil) {
+ for r := 0; r < npy.Shape[0]; r++ {
+ c.Logf("%v", onehotcols[r*npy.Shape[1]:(r+1)*npy.Shape[1]])
+ }
+ c.Check(onehotcols, check.DeepEquals, []int32{
+ 0, 0, 1, 4, 4, 4, 6, 6,
+ 2, 3, 2, 2, 3, 4, 2, 3,
+ 0, 1, 0, 0, 0, 0, 0, 0,
+ 157299, 157299, 157299, 157299, 157299, 157299, 157299, 157299,
+ 803273, 803273, 803273, 803273, 803273, 803273, 803273, 803273,
+ })
+ }
}
}