Thanks to visit codestin.com
Credit goes to github.com

Skip to content

numpy --> np #45

@pelegs

Description

@pelegs

In 2.2.2. (Buffers), python code snippet:

data = numpy.zeros(4, dtype = [ ("position", np.float32, 3),
                                ("color",    np.float32, 4)] )

The first time a numpy structure is used, it is called with the name numpy (numpy.zeros), while later numpy structures are called with the abbreviation np (np.float32, specifically).

These calls should all be uniform. As the preface states that numpy is imported as import numpy as np, numpy.zeros should be changed to np.zeros.

Edit: this also repeats in 2.2.3 (Variables).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions