Skip to content
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

rewrite matrices #7

Open
jdcaicedo251 opened this issue May 19, 2021 · 1 comment
Open

rewrite matrices #7

jdcaicedo251 opened this issue May 19, 2021 · 1 comment

Comments

@jdcaicedo251
Copy link

Is there a way I can modify the values of one matrix and store it again under the same name?

In the example, I tried:
halves = np.array(m1) * 0.5

and then:
myfile['m1']=halves

But this generates an error
NodeError: group ``/data`` already has a child node named 'm1'

In the API, I don't see an option to delete a matrix. This would allow me to use the "create_matrix" function.

@bstabler
Copy link
Member

You can drop a matrix using the pytables API

import tables
f = tables.open_file('myfile.omx', 'a')
f.remove_node("/data/MATNAME")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants