Column Statistics
View distinct values, null counts, and histograms for fields
What Are Column Statistics and Histograms?
Column statistics summarize the distribution of values in a single attribute field. Histograms visualize that distribution as a bar chart of value frequencies. Together, they answer the most basic exploratory question about a dataset: what does this column actually look like? Before you build a filter, choose a classification scheme, or run a model, you need to know the column's range, its central tendency, its spread, and whether it has outliers or missing values.
For a numeric field, descriptive statistics include count, sum, mean, median, mode, minimum, maximum, range, variance, standard deviation, and percentiles. For a string field, the equivalent is the unique value count, the top N most common values, and the count of nulls. The histogram complements the numeric stats by showing the shape of the distribution β is it symmetric, skewed, bimodal, uniform β which the summary statistics alone cannot reveal.
The gis.tools column statistics tool computes all of these metrics on the fly for any field in any loaded layer. It runs in the browser using a single pass through the FeatureCollection, then renders an interactive histogram with adjustable bin count. You can compare multiple columns side by side, export the stats as CSV, and use the results to inform downstream choices like classification breaks for Graduated Color Styling.
This is the GIS equivalent of pandas' df.describe() or R's summary() β a foundational tool for any data analysis workflow.
How Column Statistics Are Computed
Single-pass aggregation
The engine walks the FeatureCollection once, accumulating running totals for each statistic. Sum, count, min, max, sum-of-squares are all O(1) per row. Mean and variance fall out of these. Median and percentiles require a sort, which is O(N log N), but for under a million features this is still fast.
Histogram binning
For numeric fields, the histogram bins values into equally-sized intervals. The bin count is configurable; common defaults use Sturges' rule (ceil(log2(N) + 1)), Scott's rule (3.5 Γ stdev Γ N^(-1/3)), or Freedman-Diaconis (2 Γ IQR Γ N^(-1/3)). Each rule has different sensitivity to outliers.
String field analysis
For string fields, the engine builds a frequency map and reports the top N most common values, the unique count, and the null count. A bar chart shows the top values graphically.
Null handling
Nulls are excluded from numeric statistics but counted separately. The percentage of nulls is reported alongside other stats.
Key Parameters and Options
Bin count
For histograms, the number of bins controls visual granularity. Too few bins hide structure; too many create noise. Default is Sturges' rule.
Filter scope
Statistics can be computed across all features or only the currently selected/filtered subset.
Numeric vs string mode
The tool auto-detects field type and shows the appropriate stats and visualization.
Export format
Results can be exported as CSV, JSON, or copied to clipboard.
Practical Applications
Pre-classification analysis
A cartographer preparing a choropleth map of median household income across census tracts wants to choose appropriate classification breaks. They run column statistics on the income field and see that the distribution is right-skewed with a mean of $52,000 and a long tail to $250,000+. They use Jenks natural breaks instead of equal interval to avoid lumping the bulk of tracts into a single class.
Outlier detection
A biologist looking at fish length measurements runs column stats and sees that the maximum value is 2,400 cm β clearly a data entry error (probably 24 cm). They use the Attribute Filter Builder to find the offending record and correct it.
Quality assurance
A GIS analyst inheriting a parcel dataset runs column stats on the lot_area field and finds that 12% of parcels have null values. They flag this as a known data quality issue in their report and use the Data Profiling Report for a fuller picture.
Classification break selection
A public health analyst building a vulnerability index stratifies census tracts into vulnerability quintiles. Column stats show the percentile breakpoints used to assign quintile labels.
Audit trail
A municipal auditor reviewing a tax assessment dataset compares column stats year-over-year to spot suspicious shifts in the distribution.
Categorical color assignment
A planner styling parcels by zoning class wants to know which classes are most common before assigning colors. Column stats show the top zoning codes and their counts.
Modeling input prep
A machine learning engineer feeding spatial features into a model uses column stats to identify columns with high null rates that need imputation or removal.
Step-by-Step Workflow
- Load your dataset into the GeoJSON, KML, Shapefile & GIS File Viewer.
- Open the column statistics panel for the active layer.
- Pick a column from the dropdown β the panel auto-detects type.
- Read the descriptive stats (count, mean, min, max, etc.).
- Inspect the histogram to understand distribution shape.
- Adjust bin count if needed to reveal structure.
- Filter the layer and re-run to see how stats differ for the subset.
- Export results as CSV or copy to clipboard.
Worked Example
A transportation planner has a GeoJSON of 8,300 traffic intersection collision counts spanning a five-year period. They want to know how skewed the distribution is and whether a few intersections dominate the totals.
Running column stats on the collision_count field reveals: count=8300, mean=4.2, median=2, min=0, max=287, stdev=11.8. The mean is double the median, indicating a strong right skew. The histogram shows that 70% of intersections have 0-2 collisions, but a long tail extends out to nearly 300. The planner concludes that focusing safety improvements on the top 5% of intersections (those with more than 25 collisions) would address roughly 60% of total citywide collisions β a much more efficient strategy than uniform investment.
Common Pitfalls and Gotchas
- Mixed types in a column. A field that mixes numeric and string values gets analyzed as a string by default, hiding meaningful numeric stats.
- Outliers distorting the mean. Always look at median and percentiles in addition to mean.
- Nulls treated as zeros. Some tools silently coerce null to zero, biasing the mean down. Confirm null handling.
- Bin count chosen badly. Too few bins hide bimodal structure; too many show noise.
- Sample vs population variance. Some tools report sample variance (n-1 denominator), others population (n). Know which.
- Currency and unit fields. A
pricefield stored as string with$and,won't be detected as numeric. - Time series in a single column. Stats on a date field need a different visualization (timeline) than a histogram.
- Skewed distributions. Mean alone is misleading; report median and IQR too.
Tips for Best Results
- Always look at the histogram alongside the summary stats β distributions tell you things means cannot.
- Report median and IQR for skewed data; mean and stdev for symmetric data.
- Use Jenks natural breaks for classification when the distribution has natural groupings.
- Run column stats on multiple subsets to compare distributions.
- Strip currency/unit characters from numeric strings before running stats.
- Combine with the Data Profiling Report for a fuller picture.
- Export stats to CSV for inclusion in reports.
- Recompute stats after filtering to see how a subset compares to the whole.
Comparison with Pandas, R, and Desktop GIS
Pandas' df.describe() and R's summary() give the same descriptive statistics for tabular data. QGIS has a Statistics Panel that mirrors this functionality. ArcGIS has a Field Statistics dialog. The gis.tools approach is conceptually identical to all of these but runs in the browser with no install, no language to learn, and no project to set up.
For very large datasets, pandas in a Jupyter notebook is faster because it can use NumPy's vectorized operations on contiguous arrays. The browser version is fast enough for files up to a few hundred thousand features.
Performance Considerations
Single-pass numeric statistics scale linearly with feature count. For 100,000 features, expect under 100ms. Median and percentile computation requires a sort, which adds O(N log N) overhead β still under 200ms for 100k features. Histogram binning is also O(N).
Data Privacy and Browser-Based Processing
All computation happens in your browser. Attribute values, histograms, and stats are never sent to a server. This is essential for sensitive datasets where the distribution itself could reveal proprietary information (salary distributions, customer counts, etc.).
Related GIS Concepts
Descriptive statistics. Numerical summaries of a dataset: mean, median, mode, stdev, range, percentiles.
Histogram. A bar chart showing the frequency of values within equal-width bins.
Skewness and kurtosis. Higher-moment measures of distribution shape.
Five-number summary. Min, Q1, median, Q3, max β the basis of a box plot.
Frequently Asked Questions
Can I compare two columns side by side?
Most implementations let you open multiple stat panels at once.
Why does mean differ from median?
A difference indicates skewness. Mean is pulled toward outliers; median is not.
How are nulls handled?
Excluded from numeric stats but counted and reported separately.
Can I see stats for a filtered subset?
Yes β apply a filter first, then run stats on the visible features.
What bin count should I use?
Start with the default (Sturges' or Scott's rule) and adjust by eye.
Related Tools on gis.tools
Related Tools
View All ToolsFeature Identify Tool
Click features to view attributes in a popup
Query & FilterDe-duplication Tool
Find and remove duplicate features by coordinates or key
Query & FilterAttribute Filter Builder
Build SQL-like filters for feature attributes
Query & FilterSpatial Filter
Filter features within viewport or a drawn polygon
Query & FilterFull-Text Search
Search across all attributes with in-browser indexing
Query & FilterSpatial Join
Join layers spatially: points in polygons, nearest features
Query & Filter100% client-side processing - your data stays private and never leaves your device