Начало работы с Python
Начало работы с Python в ArcGIS Pro | Documentation
Под Новым проектом щелкните Карта. В окне Новый проект в поле Имя введите Начало работы с Python. В опции Местоположение укажите свою папку C:\PythonStart. Сни ...
Посчитать строки
Если вы посетите раздел справки <anchor>Посчитать строки</anchor> в разделе Параметры, щелкните Python и вы увидите, что в этом разделе есть пример кода. Примеры Python включены во все разделы справки по инструментам геообработки.
Get Count (Data Management)—ArcGIS Pro | Documentation
Back to Top

# Get Count (Data Management)

#### In this topic

## Summary

Returns the total number of rows for a table.

## Usage

- If the input is a layer or table view containing a selected set of records, only the selected records will be counted.

- This tool honors the Extent environment. Only those features that are within or intersect the Extent environment setting will be counted.

- You can view the returned row count in Geoprocessing history.

- In ModelBuilder, Get Count can be used to set up a precondition, as illustrated below. In this model, Get Count counts the number of records returned by the Select tool. If the count is zero, Buffer will not run due to the precondition.
  Using Get Count with a precondition

## Parameters

DialogPython

LabelExplanationData Type

Input Rows

The input table view or raster layer. If a selection is defined on the input, the count of the selected rows will be returned.

Table View; Raster Layer

### Derived Output

LabelExplanationData TypeRow Count
The total number of rows for the input.
Long

NameExplanationData Type

in_rows

The input table view or raster layer. If a selection is defined on the input, the count of the selected rows will be returned.

Table View; Raster Layer

### Derived Output

NameExplanationData Typerow_count
The total number of rows for the input.
Long

### Code sample

GetCount example 1 (Python window)

The following Python window script demonstrates how to use the GetCount function in immediate mode.

GetCount example 2 (stand-alone script)

The following stand-alone script is an example of how to use the GetCount function in a scripting environment.

## Environments

## Licensing information

- Basic: Yes
- Standard: Yes
- Advanced: Yes

#### Related topics

##### In this topic