Panda: Set Index
df = pd.DataFrame({'month': [1, 4, 7, 10], 'year': [2012, 2014, 2013, 2014], 'sale':[55, 40, 84, 31]}) month sale year 0 1 55 2012 1 4 40 2014 2 7 84 2013 3 10 31 2014 Set the index to become the 'month' column: df.set_index('month') sale year month 1 55 2012 4 40 2014 7 84 2013 10 31 2014 Create a multi-index using columns 'year' and 'month': ddf.set_index(['year', 'month']) sale year month 2012
| Penerbit | Taratsa |
|---|---|
| Tahun | 2019-08-08 |
| Bahasa | ind |
| Pengenal | bookid: urn:uuid:847bc0c8-444f-5b54-a2ba-1399180f4da4 |