User Tools

Site Tools


reproducible_stackoverflow_example_from_clipboard

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

reproducible_stackoverflow_example_from_clipboard [2016/10/10 16:43] (current)
vincenzo created
Line 1: Line 1:
 +It's always nice to being able to replicate results:
  
 +Create a simple df in Excel, copy-paste and create a df from a dictionary as:
 +
 +<code python>
 +
 +pd.read_clipboard().to_dict()
 +
 +#the insert it into:
 +
 +pd.DataFrame({'​Banner':​ {0: '​banner3',​ 1: '​banner1',​ 2: '​banner2'​},​
 + '​Campaign':​ {0: '​12345',​ 1: '​campaign1',​ 2: '​campaign2'​},​
 + '​Country ': {0: '​de',​ 1: '​de',​ 2: '​it'​},​
 + '​Date':​ {0: '​1/​1/​2016',​ 1: '​1/​1/​2016',​ 2: '​2/​1/​2016'​},​
 + '​Value_1':​ {0: 20, 1: 10, 2: 5}})
 +
 +
 +</​code>​
reproducible_stackoverflow_example_from_clipboard.txt ยท Last modified: 2016/10/10 16:43 by vincenzo