Skip to content

Commit

Permalink
Update string operations
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Aug 18, 2024
1 parent 75ecbbc commit f69a35d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
40 changes: 20 additions & 20 deletions book/python/04_string_operations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "bcb4d025",
"id": "0",
"metadata": {},
"source": [
"# String Operations\n",
Expand All @@ -12,7 +12,7 @@
},
{
"cell_type": "markdown",
"id": "b8d33eeb",
"id": "1",
"metadata": {},
"source": [
"## Creating and Manipulating Strings\n",
Expand All @@ -23,7 +23,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "0ef1fb56",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -32,7 +32,7 @@
},
{
"cell_type": "markdown",
"id": "f5e965b3",
"id": "3",
"metadata": {},
"source": [
"You can concatenate (join) strings using the `+` operator:"
Expand All @@ -41,7 +41,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "42526b7a",
"id": "4",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -51,7 +51,7 @@
},
{
"cell_type": "markdown",
"id": "eae07d43",
"id": "5",
"metadata": {},
"source": [
"You can also repeat strings using the `*` operator:"
Expand All @@ -60,7 +60,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "508b11d4",
"id": "6",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -70,7 +70,7 @@
},
{
"cell_type": "markdown",
"id": "5669c026",
"id": "7",
"metadata": {},
"source": [
"## String Methods for Geospatial Data\n",
Expand All @@ -85,7 +85,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "caefbc57",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -96,7 +96,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "14c657bd",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -107,7 +107,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "640f1423",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -118,7 +118,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "827dd307",
"id": "11",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -128,7 +128,7 @@
},
{
"cell_type": "markdown",
"id": "b24b43e0",
"id": "12",
"metadata": {},
"source": [
"## Formatting Strings\n",
Expand All @@ -139,7 +139,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "248322a2",
"id": "13",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -152,7 +152,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "616a001f",
"id": "14",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -162,7 +162,7 @@
},
{
"cell_type": "markdown",
"id": "58262850",
"id": "15",
"metadata": {},
"source": [
"## Parsing and Extracting Information from Strings\n",
Expand All @@ -173,7 +173,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "bc54dbed",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -186,7 +186,7 @@
},
{
"cell_type": "markdown",
"id": "6f54635f",
"id": "17",
"metadata": {},
"source": [
"## Exercises\n",
Expand All @@ -199,10 +199,10 @@
},
{
"cell_type": "markdown",
"id": "f910f3f0",
"id": "18",
"metadata": {},
"source": [
"### Conclusion\n",
"## Conclusion\n",
"\n",
"String operations are crucial in geospatial programming, especially when dealing with textual geographic data. Mastering these operations will enable you to handle and manipulate geographic information effectively in your projects."
]
Expand Down
7 changes: 1 addition & 6 deletions book/python/04_string_operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ jupytext:
format_name: myst
format_version: 0.13
jupytext_version: 1.16.2
kernelspec:
display_name: geo
language: python
name: python3
---

# String Operations
Expand Down Expand Up @@ -42,7 +38,6 @@ print(separator)
## String Methods for Geospatial Data

Python provides various built-in methods to manipulate strings. Some commonly used methods include:

- `lower()`, `upper()`: Convert strings to lowercase or uppercase.
- `strip()`: Remove leading and trailing whitespace.
- `replace()`: Replace a substring with another substring.
Expand Down Expand Up @@ -105,6 +100,6 @@ print(f"Parsed coordinates: ({latitude}, {longitude})")

+++

### Conclusion
## Conclusion

String operations are crucial in geospatial programming, especially when dealing with textual geographic data. Mastering these operations will enable you to handle and manipulate geographic information effectively in your projects.

0 comments on commit f69a35d

Please sign in to comment.