> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# aggregate_histogram

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.aggregate_histogram"> <span className="sig-name descname"><span className="pre">aggregate\_histogram</span></span><span className="sig-paren">(</span><span className="em sig-param"><span className="n"><span className="pre">table\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">column\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">start</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">end</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">interval</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">options</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">{"{"}{"}"}</span></span></span><span className="sig-paren">)</span><a href="https://github.com/kineticadb/kinetica-api-python/blob/master/gpudb/gpudb.py#L16835"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Performs a histogram calculation given a table, a column, and an interval function. The input parameter <span className="em">interval</span> is used to produce bins of that size and the result, computed over the records falling within each bin, is returned. For each bin, the start value is inclusive, but the end value is exclusive–except for the very last bin for which the end value is also inclusive. The value returned for each bin is the number of records in it, except when a column name is provided as a <span className="em">value\_column</span>. In this latter case the sum of the values corresponding to the <span className="em">value\_column</span> is used as the result instead. The total number of bins requested cannot exceed 10,000.</p>
      <p>NOTE: The Kinetica instance being accessed must be running a CUDA (GPU-based) build to service a request that specifies a <span className="em">value\_column</span>.</p>
      <p><strong>Parameters</strong></p>

      <div className="blockquote">
        <div>
          <div className="dl">
            <div className="dt">table\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name of the table on which the operation will be performed. Must be an existing table, in \[schema\_name.]table\_name format, using standard <a className="reference external" href="/content/concepts/tables/#table-name-resolution">name resolution rules</a>.</p>
            </div>

            <div className="dt">column\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name of a column or an expression of one or more column names over which the histogram will be calculated.</p>
            </div>

            <div className="dt">start (<span className="em">float</span>) –</div>

            <div className="dd">
              <p>Lower end value of the histogram interval, inclusive.</p>
            </div>

            <div className="dt">end (<span className="em">float</span>) –</div>

            <div className="dd">
              <p>Upper end value of the histogram interval, inclusive.</p>
            </div>

            <div className="dt">interval (<span className="em">float</span>) –</div>

            <div className="dd">
              <p>The size of each bin within the start and end parameters.</p>
            </div>

            <div className="dt">options (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Optional parameters. Allowed keys are:</p>

              <ul className="simple">
                <li>
                  <p><strong>value\_column</strong> – The name of the column to use when calculating the bin values (values are summed). The column must be a numerical type (int, double, long, float).</p>
                </li>

                <li>
                  <p><strong>start</strong> – The start parameter for char types.</p>
                </li>

                <li>
                  <p><strong>end</strong> – The end parameter for char types.</p>
                </li>

                <li>
                  <p><strong>interval</strong> – The interval parameter for char types.</p>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>
          </div>
        </div>
      </div>

      <p><strong>Returns</strong></p>

      <div className="blockquote">
        <div>
          <p>A dict with the following entries–</p>

          <div className="dl simple">
            <div className="dt">counts (<span className="em">list of floats</span>) –</div>

            <div className="dd">
              <p>The array of calculated values that represents the histogram data points.</p>
            </div>

            <div className="dt">start (<span className="em">float</span>) –</div>

            <div className="dd">
              <p>Value of input parameter <span className="em">start</span>.</p>
            </div>

            <div className="dt">end (<span className="em">float</span>) –</div>

            <div className="dd">
              <p>Value of input parameter <span className="em">end</span>.</p>
            </div>

            <div className="dt">info (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Additional information.</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
