Exploring Numbers and Data
Currently, there is just one way of manipulating data on your notebook, and that is with calculations blocks.
Other blocks such as tables and widgets are useful for data inputting and display.
Play with data: Calculation Block
To add a calculation block to your notebook:
- Write
/
in a new paragraph; - Select Calculations.
On calculation blocks, most operations are intuitive and natural to do since they powered by the Decipad language. Here's an example:
As you would expect, operators work as in any other mathematical context.
Each calculation block will also resume the operation result on the right for you or anyone reading to follow.
Name your data: Variables
In a calculation block, you are able to assign names to your data using the =
sign - we call it creating variables. Naming your data is very useful since it allows you to reference that data point on other blocks just by using its name.
For now, variables can't have spaces on their names, but you can use symbols or emojis. Don't forget that variables are case-sensitive, meaning that myvariable is different that MYVARIABLE.
Here are some examples on declaring a variable, where we use names or emojis as names.
Organize your data: Tables
Type /
and select Table to add a table to your notebook.
Data in a table can be text, numbers (with or without units) or dates. As with variables, you can name your table and use it in a calculation.
If you are looking to create complex tables, you can always build your own table using the Decipad language.
Connect Data and Narrative: Magic Numbers
Experimental Feature
Magic Numbers are currently being developed. This new feature allows you to embed any value from your model directly into your notebook text.
Magic numbers are the glue between your data and your notebook. If you want to incorporate a result into a paragraph, you can do so by writing the variable name between %
on any paragraph.
Here's an example
Firstly, you need to have a variable defined, in our case we have an input widget called Variable
.
Then, you can add a magic number to a paragraph using %
the-variable-you-previously-defined%
. This will create a reference to the original variable, in this example the input widget.
Check how every time the variable value changes, the magic number updates. Each time you or someone adjusts the notebook model, the magic number will be updated.