Skip to content

Commit

Permalink
Mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
s2t2 committed Sep 11, 2024
1 parent 32785de commit 6565f6e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/notes/data-processing/mapping.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ To retain a list of the transformed items, we'll need to store them for later.
In practice, to perform a mapping operation, we start with an empty list that will contain the transformed values. Then we loop through the original list as normal, but within the loop we can collect or append each transformed item into the new list. Then when the loop is finished, our new list will be full.

```{python}
symbols = ["MSFT", "AAPL", "GOOGL", "AMZN", "NFLX"]
new_list = []
for symbol in symbols:
Expand All @@ -44,6 +46,8 @@ To illustrate the iterative collection of items, we can print the full list with


```{python}
symbols = ["MSFT", "AAPL", "GOOGL", "AMZN", "NFLX"]
new_list = []
for symbol in symbols:
Expand Down

0 comments on commit 6565f6e

Please sign in to comment.