Suppose a question is asked in Stackoverflow and example data is given, what is the best way to import the example data
In order to explain this question which I am asking, let me take to a real StackOverflow post.
This post has given the following data to solve the query.
Access Type host/IP address Count
0 Authorized 206.196.21.129 23
1 Authorized 207.30.238.8 46
2 Authorized 208.62.55.75 23
3 Authorized 216.12.111.241 23
4 Authorized 63.197.98.106 23
5 Authorized 67.95.49.172 23
6 Unauthorized 207.243.167.114 23
7 Unauthorized 209.152.168.249 10
8 Unauthorized 65.166.159.14 10
9 Unauthorized 68.143.156.89 10
Now what will be the best way to import the data into Python
The methodology should be in such a way that the import is done into the python environment in a single step.
I am aware that, I can copy-paste the data into a spreadsheet -> then save it as CSV file and then import it into Python. But I need a more elegant way.
Other solution as suggested by one developer,
import pandas as pd ;
df = pd.read_clipboard()
pd.read_clipboard(), is not a universal solution across all operating system. My system (Ubuntu 19.10), I did a clipboard copying and then the result came like this. The column names were wrongly imported.
This post deals with R solution, but I am interested in a solution for Python