{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Create a data type object."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "dtype",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Object to be converted to a data type object."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "align",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Add padding to the fields to match what a C compiler would output for a similar C-struct. Can be "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "True"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " only if "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "obj",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is a dictionary or a comma-separated string. If a struct dtype is being created, this also sets a sticky alignment flag "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "isalignedstruct"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "copy",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Make a new copy of the data-type object. If "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "False"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", the result may just be a reference to a built-in data-type object."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "metadata",
              "annotation": "dict, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An optional dictionary with dtype metadata."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A numpy array is homogeneous, and contains elements described by a dtype object. A dtype object can be constructed from different combinations of fundamental numeric types."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/__init__.py",
  "item_line": null,
  "item_type": "_DTypeMeta",
  "aliases": [
    "numpy.dtype"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Using array-scalar type:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nnp.dtype(np.int16)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nStructured type, one field name 'f1', containing int16:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.dtype([('f1', np.int16)])\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nStructured type, one field named 'f1', in itself containing a structured\ntype with one field:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.dtype([('f1', [('f1', np.int16)])])\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nStructured type, two fields: the first field contains an unsigned int, the\nsecond an int32:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.dtype([('f1', np.uint64), ('f2', np.int32)])\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nUsing array-protocol type strings:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.dtype([('a','f8'),('b','S10')])\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nUsing comma-separated field formats.  The shape is (2,3):\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.dtype(\"i4, (2,3)f8\")\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nUsing tuples.  ``int`` is a fixed type, 3 the field's shape.  ``void``\nis a flexible type, here of size 10:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.dtype([('hello',(np.int64,3)),('world',np.void,10)])\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nSubdivide ``int16`` into 2 ``int8``'s, called x and y.  0 and 1 are\nthe offsets in bytes:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.dtype((np.int16, {'x':(np.int8,0), 'y':(np.int8,1)}))\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nUsing dictionaries.  Two fields named 'gender' and 'age':\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.dtype({'names':['gender','age'], 'formats':['S1',np.uint8]})\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nOffsets in bytes, here 0 and 25:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.dtype({'surname':('S25',0),'age':(np.uint8,25)})\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "result_type",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "result_type"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": null
    }
  ],
  "signature": null,
  "references": null,
  "qa": "numpy:dtype",
  "arbitrary": [],
  "local_refs": [
    "align",
    "copy",
    "dtype",
    "metadata"
  ]
}