Many times when I try to answer questions in Stackoverflow, the question contains a table that I have to convert to a pandas framework for processing. for example in this question:
http://stackoverflow.com/questions/43172116/pandas-count-some-value-in-all-columns
My question is, is there a faster way to convert it to a dataframe rather than writing:
df=pd.DataFrame({'graph':[1,2,3,4,5,6], 0:['blue','blue','red','red','blue','blue'], 1:['blue','blue','red','blue','red','blue'], 2:['blue','blue','blue','red','blue','blue'], 3:['blue','blue','blue','red','red','blue'], 4:['blue','blue','red','blue','red','blue']})
given that I can copy the text:
graph 0 1 2 3 4 1 blue blue blue blue blue 2 blue blue blue blue blue 3 blue red blue blue red 4 red blue red red blue 5 red red blue red red 6 blue blue blue blue blue