Minor Error in Streamlit Docs

In Main concepts - Streamlit Docs under Display and style data > Use magic, i think the line :

# My first app
Here's our first attempt at using data to create a table:

is supposed to come after the import statements otherwise it does not work the way it was intended.

Below are the outputs when the line is above the import statement and when it is below the import statement.

I think that string is intended to be a docstring, not to be displayed in the application.

From reading the text it feels like they are telling us how we can write something even without using st.write(), i think it would be cool if they could state that they are talking about docstring

Yeah, but the example of that is df at the bottm, not the string at the top. There is nothing technically wrong in the example, but I understand how it can be confusing to many people.

Indeed It is even more confusing if you look at the Magic, where there is a similar string at the top, apparently intended to be displayed, but some lines below you find this:

Also, magic is smart enough to ignore docstrings. That is, it ignores the strings at the top of files and functions.

So at this point I am just puzzled… Should we expect the string at the top to be displayed or not?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.