{
  "name": "pandas MultiIndex constructors: inputs and documented example sizes",
  "description": "Compares the four pandas MultiIndex constructors by the input each accepts and the number of index tuples in the example given in the official pandas 3.1.1 documentation. Compiled from the pandas user guide and API reference.",
  "page": "https://casrai.org/guides/multiindex-pandas",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-15T02:13:47Z",
  "temporalCoverage": "2026",
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Constructor",
      "unit": "",
      "description": ""
    },
    {
      "name": "Input it takes",
      "unit": "",
      "description": ""
    },
    {
      "name": "Levels in docs example",
      "unit": "",
      "description": "Number of levels in the documentation's example"
    },
    {
      "name": "Tuples in docs example",
      "unit": "",
      "description": "Number of index tuples the documentation's example produces"
    }
  ],
  "rows": [
    {
      "Constructor": "MultiIndex.from_arrays",
      "Input it takes": "List of arrays, one per level",
      "Levels in docs example": 2,
      "Tuples in docs example": 4
    },
    {
      "Constructor": "MultiIndex.from_tuples",
      "Input it takes": "List of tuples",
      "Levels in docs example": 2,
      "Tuples in docs example": 8
    },
    {
      "Constructor": "MultiIndex.from_product",
      "Input it takes": "List of iterables (all combinations)",
      "Levels in docs example": 2,
      "Tuples in docs example": 8
    },
    {
      "Constructor": "MultiIndex.from_frame",
      "Input it takes": "DataFrame (columns become levels)",
      "Levels in docs example": 2,
      "Tuples in docs example": 4
    }
  ],
  "sources": [
    {
      "title": "pandas user guide: MultiIndex / advanced indexing (pandas 3.1.1)",
      "url": "https://pandas.pydata.org/docs/user_guide/advanced.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "pandas.MultiIndex API reference (pandas 3.1.1)",
      "url": "https://pandas.pydata.org/docs/reference/api/pandas.MultiIndex.html",
      "accessed": "2026-11-14"
    }
  ]
}