8000 Numpy removes "/" at first position from dictionary string keys when saving · Issue #9265 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Numpy removes "/" at first position from dictionary string keys when saving #9265
Open
@AndreiCostinescu

Description

@AndreiCostinescu

Hi all,

I have this example

import numpy as np
s = "/home/usr/tmp.txt"
d = {s: np.array([1, 2, 3])}
np.savez('tmp', **d)
f = np.load('tmp.npz')
print(f.keys())

And the output I get is

['home/usr/tmp.txt']

I want to be able to save filepaths (so any kind of strings) as the dictionary entries (so array filenames) of the numpy .npz archive.
What would need to be done in order to achieve that the output of the above program is

['/home/usr/tmp.txt']

I am using numpy version: numpy-1.12.1 on both a windows 10 and a ubuntu 14.04 machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0