From the course: Data Science Reporting with Quarto for Python

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Inserting calculated values into sentences

Inserting calculated values into sentences

- [Instructor] Data driven sentences are one of the most powerful features of Quarto as a reporting tool. We're in values-into-sentences.qmd in the 04_04b folder. And let's preview this document with command + shift + K. Now that's previewed, we can see a sentence here with T values. We should really insert from our data. The number of values in the penguins dataset and a percentage of the those have NA values. So let's go to our input document here and let's create an inline code chunk, which we do by opening and closing a backtick. Inside of our backticks inline code chunk, we need to specify the language of the code chunk, which in this case is Python. And we're going to use the function len on penguins_df. Let's preview the document again with command + shift + k. And there we can see value from the data has been inserted. Let's also go here and calculate the percentage of the rows have NA values. So we'll open up an inline code chunk, we'll specify the language as Python, and…

Contents