-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
np.load of np.savez impossible to get values back out? #107
Comments
Can you give a a similar python code so I can test and compare? |
test_array = np.random.rand(3, 2)
test_vector = np.random.rand(4)
np.savez_compressed('/tmp/123', a=test_array, b=test_vector)
loaded = np.load('/tmp/123.npz')
print(np.array_equal(test_array, loaded['a']))
print(np.array_equal(test_vector, loaded['b'])) |
This is not a fix but a workaround [TestMethod]
public async Task IssueByMrCOrrupted()
{
Dictionary<string, NDarray> arrays = new Dictionary<string, NDarray>();
arrays["a"] = np.arange(6).reshape(2, 3);
arrays["b"] = np.arange(3);
var filename = Path.Combine(Path.GetTempPath(), "test.npz");
np.savez_compressed(filename, null, arrays);
var archive = np.load(filename);
Console.WriteLine(archive.repr);
var a = new NDarray( archive.PyObject["a"]);
var b = new NDarray( archive.PyObject["b"]);
Console.WriteLine(a.repr);
Console.WriteLine(b.repr);
} |
henon
added a commit
that referenced
this issue
Nov 16, 2022
henon
changed the title
np.load of np.savez impossible to get values back out
np.load of np.savez impossible to get values back out?
Nov 16, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
after saving some arrays into a .npz archive like so
its impossible to get the values back out
it just results in a
System.ArgumentException: 'Invalid slice notation'
The text was updated successfully, but these errors were encountered: