Search…
🔀
Data Manipulation
Now we're going to access an API, and manipulate the outputted json. Then we will organise our code so that we, and others, can navigate it easily.

Lesson 1: Mapping

The first lesson in data manipulation introduces mapping - the most frequent dataflow alternative to loops through determining the USD exchange rates of each currency in a crypto wallet.
Lesson 1

Lesson 2: Building and Joining Dictionaries

Though not strictly fundamental transformations, these ways of merging lists are very common. In the provided example they’re used for replacing the keys of a dictionary.
Lesson 2

Lesson 3: Mapping with External Data

This lesson takes you deeper into the realm of mapping, where items of the result depend on more than just the original items. Without it, it would be difficult to convert each currency to USD, given that rates and amounts are stored in a separate dictionary.
Lesson 3

Lesson 4: Reducing

Summing up numbers? It’s an application of reducing. In this lesson we’ll finally get to know how much USD in total the contents of the example crypto wallet are worth.
Lesson 4

Lesson 5: Filtering

This lesson introduces filtering - removing items from arrays and dictionaries. Some special items need special treatment! For example, converting USDT to USDT.
Lesson 5

Lesson 6: Organising Our Code

Now it's time to name your code, and group it, in a way that it's easy for yourself, or others, to understand and maintain. This final lesson in the Data Manipulation series shows off one of CRANQ's best features, the ability to create comprehensible code
Lesson 6
Copy link
On this page
Lesson 1: Mapping
Lesson 2: Building and Joining Dictionaries
Lesson 3: Mapping with External Data
Lesson 4: Reducing
Lesson 5: Filtering
Lesson 6: Organising Our Code