Skip to content

Commit

Permalink
Complete proofreading changes for c2, close #262
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Oct 5, 2024
1 parent d5d08b6 commit 2c9ba99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions 02-attribute-operations.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ The standard **numpy** comparison operators (@tbl-comparison-operators) can be u

: Comparison operators that return boolean values (`True`/`False`). {#tbl-comparison-operators}

The following example demonstrates logical vectors for subsetting by creating a new `GeoDataFrame` object called `small_countries` that contains only those countries and other teritories from the `world` object whose surface area is smaller than 10,000 $km^2$.
The following example demonstrates logical vectors for subsetting by creating a new `GeoDataFrame` object called `small_countries` that contains only those countries and other territories from the `world` object whose surface area is smaller than 10,000 $km^2$.
The first step is to create a logical vector (a `Series` object) that is `True` for countries with an area smaller than 10,000 $km^2$ and `False` otherwise.
Then, we use this vector to subset the `world` dataset, which returns a new `GeoDataFrame` object containing only the small countries.

Expand Down Expand Up @@ -299,7 +299,7 @@ In the following code example, given the `world_agg3` continent summary (@fig-sp

- drop the geometry column,
- calculate population density of each continent,
- arrange continents by the number countries they contain, and
- arrange continents by the number countries each contains, and
- keep only the 3 most populous continents.

```{python}
Expand Down Expand Up @@ -396,7 +396,7 @@ world2

The resulting `GeoDataFrame` object has a new column called `con_reg` representing the continent and region of each country, e.g., `'South America:Americas'` for Argentina and other South America countries.
The opposite operation, splitting one column into multiple columns based on a separator string, is done using the `.str.split` method.
As a result we go back to the previous state of two separate `continent` and `region_un` columns (only that their position is now last, since they are newly created).
As a result, we go back to the previous state of two separate `continent` and `region_un` columns (only that their position is now last, since they are newly created).
The `str.split` method returns a column of `list`s by default; to place the strings into separate `str` columns we use the `expand=True` argument.

```{python}
Expand Down Expand Up @@ -450,7 +450,7 @@ world2

Raster cell values can be considered the counterpart of vector attribute values.
In this section, we cover operations that deal with raster values in a similar way, namely as a series of numbers.
This type of operations include subsetting raster values (@sec-raster-subsetting) and calculating global summaries of raster values (@sec-summarizing-raster-objects).
This type of operations includes subsetting raster values (@sec-raster-subsetting) and calculating global summaries of raster values (@sec-summarizing-raster-objects).

### Raster subsetting {#sec-raster-subsetting}

Expand Down Expand Up @@ -519,7 +519,7 @@ elev1
```

Now we can insert an `np.nan` value into the array, for example to a cell located in the first row and third column.
(Doing so in the original `elev` array raises an error, because an `int` array cannot accomodate `np.nan`, as mentioned above; try it to see for yourself.)
(Doing so in the original `elev` array raises an error, because an `int` array cannot accommodate `np.nan`, as mentioned above; try it to see for yourself.)

```{python}
elev1[0, 2] = np.nan
Expand Down

1 comment on commit 2c9ba99

@michaeldorman
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks @Robinlovelace !

Please sign in to comment.