What is the average population per zip code




















They probably tend to expect things to be more uniformly distributed than they really are. The enthusiasts have read books about fractals, networks, power laws, etc. Within the skeptics are the pedants. Nothing follows any theoretical distribution exactly and everywhere. If you asked a power law enthusiast how zip code populations are distributed, their first guess would of course be a power law. But a power law implies more than just the o rule.

The signature of a power law is a straight line on a log-log plot. Power laws never hold exactly and everywhere, but a lot of things approximately follow a power law over a useful range, typically in the middle. This looks more like a squircle than a straight line. If we zoom in on just part of the plot, say the largest 2, zip codes [1], we get something that has a flat spot, but plot bows outward, and continues to bow outward as we zoom in on different parts of it.

Why is the distribution of zip code populations not a power law? One reason is that zip codes are artificial. They were designed to make it easier to distribute mail, and so there was a deliberate effort to make them somewhat uniform in population. The population of the largest zip code is only 12 times the average. Each document in the zipcodes collection has the following form:. All of the following examples use the aggregate helper in mongosh.

The aggregate method uses the aggregation pipeline to process documents into aggregated results. An aggregation pipeline consists of stages with each stage processing the documents as they pass along the pipeline. Documents pass through the stages in sequence. The aggregate method in mongosh provides a wrapper around the aggregate database command. See the documentation for your driver for a more idiomatic interface for data aggregation operations.

The following aggregation operation returns all states with total population greater than 10 million:.



0コメント

  • 1000 / 1000