Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8140811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:17:19+00:00 2026-06-06T12:17:19+00:00

I realize that a SO user has formerly asked this question but it was

  • 0

I realize that a SO user has formerly asked this question but it was asked in 2009 and I was hoping that more knowledge of HDF5 was available or newer versions had fixed this particular issue. To restate the question here concerning my own problem;

I have a gigantic file of nodes and elements from a large geometry and have already retrieved all the useful information I need from it. Therefore, in Python, I am trying to keep the original file, but delete the information I do not need and fill in more information for other sources. For example, I have a dataset of nodes that I don’t need. However, I need to keep the neighboring dataset and include information about their indices from an outside file. Is there any way to delete these specific datasets?

Or is the old idea of having “placekeepers” in the HDF5 file still holding true, such that no one knows how/bothers with removing info? I’m not too worried about the empty space, as long as it is faster to simply remove and add on information then to create an entirely new file.

Note: I’m using H5py’s ‘r+’ to read and write.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:17:21+00:00Added an answer on June 6, 2026 at 12:17 pm

    Removing entire nodes (groups or datasets) from a hdf5 file should be no problem.
    However if you want to reclaim the space you have to run the h5repack tool.

    From the hdf5 docs:

    5.5.2. Deleting a Dataset from a File and Reclaiming Space

    HDF5 does not at this time provide an easy mechanism to remove a
    dataset from a file or to reclaim the storage space occupied by a
    deleted object.

    Removing a dataset and reclaiming the space it used can be done with
    the H5Ldelete function and the h5repack utility program. With the
    H5Ldelete function, links to a dataset can be removed from the file
    structure. After all the links have been removed, the dataset becomes
    inaccessible to any application and is effectively removed from the
    file. The way to recover the space occupied by an unlinked dataset is
    to write all of the objects of the file into a new file. Any unlinked
    object is inaccessible to the application and will not be included in
    the new file. Writing objects to a new file can be done with a custom
    program or with the h5repack utility program.

    Alternatively you can also have a look into PyTables`s ptrepack tool.
    PyTables should be able to read h5py hdf5 files and the ptrepack tool is similar to the h5repack.

    If you want to remove records from a datasets, then you probably have to retrieve the records you want to keep and create a new dataset and remove the old one.
    PyTables supports removing rows, however it’s not recommended.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realize that this question has been asked 100times but none that I have
I realize that this type of question has been asked several times before but
I realize that this is probably a very basic question, but I have spent
Perhaps this question has been asked before in a different way, but I haven’t
I realize that the answer to this question is likely quite obvious (if somewhat
UPDATE: I've realized that the below problem only occurs if the user has already
I wrote the following pre-commit script for SVN to validate that a user has
While I realize that a SlideMaster has a unique name in a given presentation
I have a CustomAuthorize attribute that checks to see if a user has access
I realize that ASP.NET MVC has all the hype. I have my doubts that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.