QGIS/python/core/auto_generated/qgsstatisticalsummary.sip.in

336 lines
9.0 KiB
Plaintext
Raw Normal View History

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsstatisticalsummary.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsStatisticalSummary
{
%Docstring
Calculator for summary statistics for a list of doubles.
2017-12-15 10:36:55 -04:00
Statistics are calculated by calling calculate() and passing a list of doubles. The
individual statistics can then be retrieved using the associated methods. Note that not all statistics
are calculated by default. Statistics which require slower computations are only calculated by
specifying the statistic in the constructor or via setStatistics().
.. versionadded:: 2.9
%End
%TypeHeaderCode
#include "qgsstatisticalsummary.h"
%End
public:
enum Statistic
{
Count,
CountMissing,
Sum,
Mean,
Median,
StDev,
StDevSample,
Min,
Max,
Range,
Minority,
Majority,
Variety,
FirstQuartile,
ThirdQuartile,
InterQuartileRange,
First,
Last,
2015-05-03 17:10:32 +02:00
All
};
typedef QFlags<QgsStatisticalSummary::Statistic> Statistics;
2017-05-01 12:53:35 +03:00
QgsStatisticalSummary( QgsStatisticalSummary::Statistics stats = QgsStatisticalSummary::All );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsStatisticalSummary
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param stats: flags for statistics to calculate
%End
virtual ~QgsStatisticalSummary();
Statistics statistics() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns flags which specify which statistics will be calculated. Some statistics
are always calculated (e.g., sum, min and max).
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setStatistics`
%End
2017-05-01 12:53:35 +03:00
void setStatistics( QgsStatisticalSummary::Statistics stats );
%Docstring
2017-12-15 10:36:55 -04:00
Sets flags which specify which statistics will be calculated. Some statistics
are always calculated (e.g., sum, min and max).
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param stats: flags for statistics to calculate
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`statistics`
%End
void reset();
%Docstring
2017-12-15 10:36:55 -04:00
Resets the calculated values
%End
void calculate( const QList<double> &values );
%Docstring
2017-12-15 10:36:55 -04:00
Calculates summary statistics for a list of values
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param values: list of doubles
%End
void addValue( double value );
%Docstring
2017-12-15 10:36:55 -04:00
Adds a single value to the statistics calculation. Calling this method
allows values to be added to the calculation one at a time. For large
quantities of values this may be more efficient then first adding all the
values to a list and calling calculate().
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param value: value to add
.. note::
call reset() before adding the first value using this method
2018-01-12 20:51:17 -04:00
to clear the results from any previous calculations
2017-12-15 10:36:55 -04:00
.. note::
finalize() must be called after adding the final value and before
2018-01-12 20:51:17 -04:00
retrieving calculated statistics.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`calculate`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`addVariant`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`finalize`
2017-12-15 10:36:55 -04:00
.. versionadded:: 2.16
%End
void addVariant( const QVariant &value );
%Docstring
2017-12-15 10:36:55 -04:00
Adds a single value to the statistics calculation. Calling this method
allows values to be added to the calculation one at a time. For large
quantities of values this may be more efficient then first adding all the
values to a list and calling calculate().
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param value: variant containing to add. Non-numeric values are treated as null.
.. note::
call reset() before adding the first value using this method
2018-01-12 20:51:17 -04:00
to clear the results from any previous calculations
2017-12-15 10:36:55 -04:00
.. note::
finalize() must be called after adding the final value and before
2018-01-12 20:51:17 -04:00
retrieving calculated statistics.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`addValue`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`calculate`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`finalize`
2017-12-15 10:36:55 -04:00
.. versionadded:: 2.16
%End
void finalize();
%Docstring
2017-12-15 10:36:55 -04:00
Must be called after adding all values with addValues() and before retrieving
any calculated statistics.
.. seealso:: :py:func:`addValue`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`addVariant`
2017-12-15 10:36:55 -04:00
.. versionadded:: 2.16
%End
2017-05-01 12:53:35 +03:00
double statistic( QgsStatisticalSummary::Statistic stat ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the value of a specified statistic
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param stat: statistic to return
:return: calculated value of statistic. A NaN value may be returned for invalid
statistics.
%End
int count() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns calculated count of values
%End
int countMissing() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the number of missing (null) values
.. versionadded:: 2.16
%End
double sum() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns calculated sum of values
%End
double mean() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns calculated mean of values. A NaN value may be returned if the mean cannot
be calculated.
%End
double median() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns calculated median of values. This is only calculated if Statistic.Median has
been specified in the constructor or via setStatistics. A NaN value may be returned if the median cannot
be calculated.
%End
double min() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns calculated minimum from values. A NaN value may be returned if the minimum cannot
be calculated.
%End
double max() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns calculated maximum from values. A NaN value may be returned if the maximum cannot
be calculated.
%End
double range() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns calculated range (difference between maximum and minimum values). A NaN value may be returned if the range cannot
be calculated.
%End
double first() const;
%Docstring
Returns the first value obtained. A NaN value may be returned if no values were encountered.
.. seealso:: :py:func:`last`
.. versionadded:: 3.6
%End
double last() const;
%Docstring
Returns the last value obtained. A NaN value may be returned if no values were encountered.
.. seealso:: :py:func:`first`
.. versionadded:: 3.6
%End
double stDev() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns population standard deviation. This is only calculated if Statistic.StDev has
been specified in the constructor or via setStatistics. A NaN value may be returned if the standard deviation cannot
be calculated.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`sampleStDev`
%End
double sampleStDev() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns sample standard deviation. This is only calculated if Statistic.StDev has
been specified in the constructor or via setStatistics. A NaN value may be returned if the standard deviation cannot
be calculated.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`stDev`
%End
int variety() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns variety of values. The variety is the count of unique values from the list.
This is only calculated if Statistic.Variety has been specified in the constructor
or via setStatistics.
%End
double minority() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns minority of values. The minority is the value with least occurrences in the list
This is only calculated if Statistic.Minority has been specified in the constructor
or via setStatistics. A NaN value may be returned if the minority cannot
be calculated.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`majority`
%End
double majority() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns majority of values. The majority is the value with most occurrences in the list
This is only calculated if Statistic.Majority has been specified in the constructor
or via setStatistics. A NaN value may be returned if the majority cannot
be calculated.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`minority`
%End
2015-05-03 17:10:32 +02:00
double firstQuartile() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the first quartile of the values. The quartile is calculated using the
"Tukey's hinges" method. A NaN value may be returned if the first quartile cannot
be calculated.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`thirdQuartile`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`interQuartileRange`
%End
double thirdQuartile() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the third quartile of the values. The quartile is calculated using the
"Tukey's hinges" method. A NaN value may be returned if the third quartile cannot
be calculated.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`firstQuartile`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`interQuartileRange`
%End
double interQuartileRange() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the inter quartile range of the values. The quartiles are calculated using the
"Tukey's hinges" method. A NaN value may be returned if the IQR cannot
be calculated.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`firstQuartile`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`thirdQuartile`
%End
2017-05-01 12:53:35 +03:00
static QString displayName( QgsStatisticalSummary::Statistic statistic );
%Docstring
2017-12-15 10:36:55 -04:00
Returns the friendly display name for a statistic
2017-12-15 21:36:08 -04:00
:param statistic: statistic to return name for
%End
};
QFlags<QgsStatisticalSummary::Statistic> operator|(QgsStatisticalSummary::Statistic f1, QFlags<QgsStatisticalSummary::Statistic> f2);
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsstatisticalsummary.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/