I'm new to stackoverflow, so sorry if this is basic. I'm trying to show a code block with sample output to clarify my question. I know how to add a code block (indenting with 4 space) but I can't figure out how to show the output.
import pandas as pd
df = pd.DataFrame({'item_id':[1,2,1,1,2],
'shop_id':['S1', 'S1', 'S1', 'S2', 'S2'],
'price':[10, 20, 10, 12, 18]})
df
In a Jupyter notebook, the above will print the dataframe and I have seen other posts displaying results. How can do it?
Attempts:
- I have gone through this post which suggests that I can copy and paste the output from Jupyter but that didn't work.
- I have tried to save my notebook as htmlHTML and then insert the html snippet here. I thought when I run it it would display the output but it shows the entire html code instead.
- Take a screenshot of my notebook and insert a link to it here. But I don't think this is the proper way to ask a question.
Please see example of what I wanted to post
Thank you! Please see example of what I wanted to post: