This is a question from someone who tries to answer questions about pandas dataframes. Consider a question with a given dataset which is just the visualization (not the actual code), for example:
numbers letters dates all
0 1 a 20-10-2020 NaN
1 2 b 21-10-2020 b
2 3 c 20-11-2020 4
3 4 d 20-10-2021 20-10-2020
4 5 e 10-10-2020 3.14
Is it possible to quickly import this in python as a dataframe or as a dictionary? So far I copied the given text and transformed it to a dataframe by making strings (adding ''
) and so on.
I think there are two 'solutions' for this:
- Make a function that given the text as input, it somehow transforms it to a dataframe.
- Use some function in the text-editor (I use spyder) which can do this trick for us.