How do I show my pandas dataframe that I have in my jupyter notebook so that I can ask a question on stack exchange/stack overflow? I've noticed that people produce such an amazing pandas dataframe which allows people to answer the questions. However, whenever I try to copy my table after doing df.head(), and "paste" it on here so that I am able to ask a question it leaves me with a table that needs to be restructured. 

I have searched for similar questions here but have been struggling to find a step-by-step answer on how to ask questions especially when it is related to pandas and that one has to get a sense of the data at hand before being able to provide an answer.
df.head().to_dict()


will give something which looks like


  {'x': {0: 1, 1: 200, 2: 4, 3: 5, 4: 6}, 'y': {0: 4, 1: 5, 2: 10, 3: 24, 4: 4}}


you can then add pd.DataFrame() like so

pd.DataFrame({'x': {0: 1, 1: 200, 2: 4, 3: 5, 4: 6}, 
              'y': {0: 4, 1: 5, 2: 10, 3: 24, 4: 4}})


This will allow anybody else just to copy and paste into their editor and run your code.

Here is a really detailed discussion on what you are describing
https://stackoverflow.com/a/20159305/6646710