concept range in category pandas

appears as: rge, range, rge
Pandas in Action

This is an excerpt from Manning's book Pandas in Action.

Once you become familiar with its complexities, programming leads to much greater opportunities for specificity and customization in the ways you manipulate your datasets. But code does more than just extend the range of available routines. It also allows for those routines to be automated. A piece of Python code can be written once and used to perform the same business logic on similar data files. That's perfect for those pesky daily and weekly reports. By most developer's standards, Python is significantly easier to pick up than Visual Basic for Applications, the equivalent programming language for automation in Microsoft applications.

The arange function returns a one-dimensional ndarray object with a range of sequential numeric values. Its first argument represents the upper bound, the point at which the range will terminate. The upper bound is exclusive, which means the range will go up to that value but not include it. When arange is invoked with one argument, NumPy will set 0 as the lower bound, the point at which the range begins. The lower bound is inclusive; its value will be included.

In [2] np.arange(3)
Out [2] array([0, 1, 2])

We can also pass arange two arguments to mark the lower and upper bounds of the range. The starting point will remain inclusive while the endpoint will remain exclusive. In the next example, notice how 2 is included but 6 is not.