{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The methods to estimate the optimal number of bins are well founded in literature, and are inspired by the choices R provides for histogram visualisation. Note that having the number of bins proportional to "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "n^{1/3}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is asymptotically optimal, which is why it appears in most estimators. These are simply plug-in methods that give good starting points for number of bins. In the equations below, "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "h"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the binwidth and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "n_h"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the number of bins. All estimators that compute bin counts are recast to bin width using the "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "ptp",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " of the data. The final bin count is obtained from "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "np.round(np.ceil(range / h))"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". The final bin width is often less than what is returned by the estimators below."
            }
          ]
        },
        {
          "__type": "DefList",
          "__tag": 4033,
          "children": [
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "'auto' (minimum bin width of the 'sturges' and 'fd' estimators)"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A compromise to get a good value. For small datasets the Sturges     value will usually be chosen, while larger datasets will usually     default to FD.  Avoids the overly conservative behaviour of FD     and Sturges for small and large datasets respectively.     Switchover point is usually "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "a.size \\approx 1000"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "'fd' (Freedman Diaconis Estimator)"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "h = 2 \\frac{IQR}{n^{1/3}}"
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The binwidth is proportional to the interquartile range (IQR)     and inversely proportional to cube root of a.size. Can be too     conservative for small datasets, but is quite good for large     datasets. The IQR is very robust to outliers."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "'scott'"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "h = \\sigma \\sqrt[3]{\\frac{24 \\sqrt{\\pi}}{n}}"
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The binwidth is proportional to the standard deviation of the     data and inversely proportional to cube root of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x.size"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Can     be too conservative for small datasets, but is quite good for     large datasets. The standard deviation is not very robust to     outliers. Values are very similar to the Freedman-Diaconis     estimator in the absence of outliers."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "'rice'"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "n_h = 2n^{1/3}"
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The number of bins is only proportional to cube root of     "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "a.size"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". It tends to overestimate the number of bins and it     does not take into account data variability."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "'sturges'"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "n_h = \\log _{2}(n) + 1"
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The number of bins is the base 2 log of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "a.size"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ".  This     estimator assumes normality of data and is too conservative for     larger, non-normal datasets. This is the default method in R's     "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "hist"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " method."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "'doane'"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "n_h = 1 + \\log_{2}(n) +\\log_{2}\\left(1 + \\frac{|g_1|}{\\sigma_{g_1}}\\right)"
                },
                {
                  "__type": "Blockquote",
                  "__tag": 4059,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "g_1 = ean\\lft[\\lft(\\frac{x - mu}{sigma}right)^3right]"
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "sigma_{g_1} = srt{\\frac{6(n - 2)}{(n + 1)(n + 3)}}"
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An improved version of Sturges' formula that produces better     estimates for non-normal datasets. This estimator attempts to     account for the skew of the data."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DefListItem",
              "__tag": 4037,
              "dt": {
                "__type": "Paragraph",
                "__tag": 4045,
                "children": [
                  {
                    "__type": "Text",
                    "__tag": 4046,
                    "value": "'sqrt'"
                  }
                ]
              },
              "dd": [
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "n_h = \\sqrt n"
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The simplest and fastest estimator. Only takes into account the     data size."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Additionally, if the data is of integer dtype, then the binwidth will never be less than 1."
            }
          ]
        }
      ],
      "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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "bin_edges",
              "annotation": "array of dtype float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The edges to pass into "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "histogram",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "numpy:histogram_bin_edges"
                      },
                      "kind": "module"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Function to calculate only the edges of the bins used by the "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "histogram",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "numpy:histogram_bin_edges"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " function."
            }
          ]
        }
      ],
      "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": "a",
              "annotation": "array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Input data. The histogram is computed over the flattened array."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "bins",
              "annotation": "int or sequence of scalars or str, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "bins"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is an int, it defines the number of equal-width bins in the given range (10, by default). If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "bins"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is a sequence, it defines the bin edges, including the rightmost edge, allowing for non-uniform bin widths."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "bins"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is a string from the list below, "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "histogram_bin_edges",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "numpy:histogram_bin_edges"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " will use the method chosen to calculate the optimal bin width and consequently the number of bins (see the Notes section for more detail on the estimators) from the data that falls within the requested range. While the bin width will be optimal for the actual data in the range, the number of bins will be computed to fill the entire range, including the empty portions. For visualisation, using the 'auto' option is suggested. Weighted data is not supported for automated bin size selection."
                    }
                  ]
                },
                {
                  "__type": "DefList",
                  "__tag": 4033,
                  "children": [
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "'auto'"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Minimum bin width between the 'sturges' and 'fd' estimators.     Provides good all-around performance."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "'fd' (Freedman Diaconis Estimator)"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Robust (resilient to outliers) estimator that takes into     account data variability and data size."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "'doane'"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "An improved version of Sturges' estimator that works better     with non-normal datasets."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "'scott'"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Less robust estimator that takes into account data variability     and data size."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "'stone'"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Estimator based on leave-one-out cross-validation estimate of     the integrated squared error. Can be regarded as a generalization     of Scott's rule."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "'rice'"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Estimator does not take variability into account, only data     size. Commonly overestimates number of bins required."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "'sturges'"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "R's default method, only accounts for data size. Only     optimal for gaussian data and underestimates number of bins     for large non-gaussian datasets."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "'sqrt'"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Square root (of data size) estimator, used by Excel and     other programs for its speed and simplicity."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "range",
              "annotation": "(float, float), optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The lower and upper range of the bins.  If not provided, range is simply "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(a.min(), a.max())"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ".  Values outside the range are ignored. The first element of the range must be less than or equal to the second. "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "range"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " affects the automatic bin computation as well. While bin width is computed to be optimal based on the actual data within "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "range"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", the bin count will fill the entire range including portions containing no data."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "weights",
              "annotation": "array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An array of weights, of the same shape as "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ".  Each value in "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " only contributes its associated weight towards the bin count (instead of 1). This is currently not used by any of the bin estimators, but may be in the future."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "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": "/numpy/lib/_histograms_impl.py",
  "item_line": 473,
  "item_type": "_ArrayFunctionDispatcher",
  "aliases": [
    "numpy.histogram_bin_edges"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\narr = np.array([0, 0, 0, 1, 2, 3, 3, 4, 5])\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.histogram_bin_edges(arr, bins='auto', range=(0, 1))\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.histogram_bin_edges(arr, bins=2)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nFor consistency with histogram, an array of pre-computed bins is\npassed through unmodified:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.histogram_bin_edges(arr, [1, 2])\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThis function allows one set of bins to be computed, and reused across\nmultiple histograms:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "shared_bins = np.histogram_bin_edges(arr, bins='auto')\nshared_bins\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "group_id = np.array([0, 1, 1, 0, 1, 1, 0, 1, 1])\nhist_0, _ = np.histogram(arr[group_id == 0], bins=shared_bins)\nhist_1, _ = np.histogram(arr[group_id == 1], bins=shared_bins)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "hist_0; hist_1\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nWhich gives more easily comparable results than using separate bins for\neach histogram:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "hist_0, bins_0 = np.histogram(arr[group_id == 0], bins='auto')\nhist_1, bins_1 = np.histogram(arr[group_id == 1], bins='auto')\nhist_0; hist_1\nbins_0; bins_1\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "histogram",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "numpy:histogram_bin_edges"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "a",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "bins",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "10"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "range",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "weights",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "histogram_bin_edges"
  },
  "references": null,
  "qa": "numpy:histogram_bin_edges",
  "arbitrary": [],
  "local_refs": [
    "a",
    "bin_edges",
    "bins",
    "range",
    "weights"
  ]
}