Introduction to notebooks in Fabric
1. Introduction to notebooks in Fabric
So far, we've covered data retrieval and storage. Now let's turn to data analysis, starting with a Fabric notebook.2. What is a notebook?
A Fabric notebook is like an interactive laboratory: an environment where we analyze data step by step and observe each result. The work happens in code cells, where each cell performs one task. For example, one cell might load a sales table, the next might filter it to a single region, and a third might calculate the total revenue. Running the analysis one step at a time makes notebooks useful for exploring, transforming, and experimenting with data.3. Code cells
Each code cell performs one task and can be run on its own. To run a cell, we click the play button on its left, and the results appear directly below it. Because every cell displays its own output, it's easy to inspect each stage of the analysis before continuing.4. The role of kernels in a notebook
A notebook relies on a kernel. A kernel is the program that executes the code you put in code cells and returns the results. There are three types of kernels. The Spark kernel runs code across many machines in parallel, for big data processing. The Python kernel runs simple Python code. The T-SQL kernel runs database queries using SQL. The Spark kernel is selected by default when we create a new notebook.5. Spark and PySpark
Since Spark is the default kernel, let's look at what makes it special. Spark is designed for very large datasets. It divides data-processing work into smaller tasks and runs them in parallel, which makes processing much faster. PySpark, which is part of the Spark kernel rather than a separate kernel, lets users give Spark instructions using Python. It can be used in notebooks and workflows. Think of it as Python's interface to Spark. Spark also supports Scala, SQL, and R.6. Lakehouse attachment
To analyze data, a notebook first needs access to it. The simplest way is attaching a lakehouse, which connects the notebook to stored data. Once attached, the notebook can both read and write data in the lakehouse's files and tables. The data remains in its storage location while the notebook performs the analysis.7. Data exploration
A common first use of a notebook is data exploration. Before analyzing data in depth, we need to understand what we're working with. We preview rows, inspect columns, count records, and search for missing or unusual values. That tells us whether the data is ready for further analysis.8. Transformation and data science
A notebook also supports data transformation and data science. If exploration reveals problems in the data, transformation fixes them. It cleans errors, combines sources, and restructures the data into prepared tables. Data science then goes a step further. We test hypotheses, search for patterns, and may build models that make predictions. Notebooks provide a flexible environment for both activities.9. Recap of notebook features
Let's recap. A notebook is an interactive environment for analyzing data with code. Code cells divide the work into separate steps, and each cell shows its own result. A lakehouse attachment gives the notebook access to stored data. The notebook can then explore and transform data, and perform data science.10. Let's practice!
Now, let's test our understanding of the role of a notebook in a Fabric environment.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.