Created
October 19, 2017 12:21
-
-
Save MartinThoma/e9b072c5314d3d5d2507aba8a86b0d6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> df = pd.DataFrame([{'id': 1, 'price': 123, 'name': 'anna', 'amount': 1}, | |
... {'id': 1, 'price': 7, 'name': 'anna', 'amount': 2}, | |
... {'id': 2, 'price': 42, 'name': 'bob', 'amount': 30}, | |
... {'id': 3, 'price': 1, 'name': 'charlie', 'amount': 10}, | |
... {'id': 3, 'price': 2, 'name': 'david', 'amount': 100}]) | |
>>> df | |
amount id name price | |
0 1 1 anna 123 | |
1 2 1 anna 7 | |
2 30 2 bob 42 | |
3 10 3 charlie 1 | |
4 100 3 david 2 | |
>>> df.ix[2, 'name'] = 'foobaaaaa' | |
>>> df | |
amount id name price | |
0 1 1 anna 123 | |
1 2 1 anna 7 | |
2 30 2 foobaaaaa 42 | |
3 10 3 charlie 1 | |
4 100 3 david 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment