बदलने के लिए कैसे indeces में पंडों dataframe
>>> df.set_index('month')
year sale
month
1 2012 55
4 2014 40
7 2013 84
10 2014 31
स्तंभ पांडा के लिए सूचकांक सेट करें
df = df.set_index('col')
df['col'] = df.index
डेटाफ्रेम पायथन में इंडेक्स कैसे बदलें
index = [1,2]
df.index = index
पांडा इंडेक्स से एक कॉलम बनाते हैं
df.reset_index(level=0, inplace=True)
पांडा सूचकांक को स्तंभ में परिवर्तित करते हैं
df.reset_index(inplace=True)
इंडेक्स कॉलम को सामान्य कॉलम के रूप में कैसे बनाया जाए
df.reset_index(level=0, inplace=True)