How to copy/paste DataFrame from Stack Overflow into Python
In questions and answers , users very often post an example DataFrame which their question/answer works with: In []: x Out[]: bar foo 0 4 1 1 5 2 2 6 3 It'd be really useful to be able to get this DataFrame into my Python interpreter so I can start debugging the question, or testing the answer. How can I do this? Pandas is written by people that really know what people want to do. Since version 0.13 there's a function pd.read_clipboard which is absurdly effective at making this "just work". Copy and paste the part of the code in the question that starts bar foo , (i.e. the DataFrame) and do