I have dataframe just like that:
df = pd.DataFrame({
'timestamp': ['2017-06-04 07:59:42', '2017-06-04 07:59:42',
'2017-06-04 07:59:42', '2017-06-04 07:59:42',
'2017-06-04 07:59:42'],
'municipality_id': [9, 8, 4, 0, 7],
'usage': [454, 556, 1090, 204, 718],
'total_capacity': [1332, 2947, 3893, 2813, 2019]
})
| timestamp | municipality_id | usage | total_capacity |
|---|---|---|---|
| 2017-06-04 07:59:42 | 9 | 454 | 1332 |
| 2017-06-04 07:59:42 | 8 | 556 | 2947 |
| 2017-06-04 07:59:42 | 4 | 1090 | 3893 |
| 2017-06-04 07:59:42 | 0 | 204 | 2813 |
| 2017-06-04 07:59:42 | 7 | 718 | 2019 |
So how can I get the first ten characters of every row of first column like:
0 2017-06-04
1 2017-06-04
2 2017-06-04
3 2017-06-04
4 2017-06-04