From 6565f6e442090d9656a17d628b7c1f2be5179e7b Mon Sep 17 00:00:00 2001 From: MJ Rossetti Date: Wed, 11 Sep 2024 16:40:29 -0400 Subject: [PATCH] Mapping --- docs/notes/data-processing/mapping.qmd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/notes/data-processing/mapping.qmd b/docs/notes/data-processing/mapping.qmd index f50ee10..deb48ac 100644 --- a/docs/notes/data-processing/mapping.qmd +++ b/docs/notes/data-processing/mapping.qmd @@ -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: @@ -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: