Loading every nth element with numpy.fromfile [duplicate]
问题 This question already has an answer here : Read binary flatfile and skip bytes (1 answer) Closed 19 days ago . I want to create a numpy array from a binary file using np.fromfile . The file contains a 3D array, and I'm only concerned with a certain cell in each frame. x = np.fromfile(file, dtype='int32', count=width*height*frames) vals = x[5::width*height] The code above would work in theory, but my file is very large and reading it all into x causes memory errors. Is there a way to use