python - reorder column in pandas pivot table -


How do I reorder the land use column in this data frame:

field answers using South land corn 2005 L49l02k3744 2078875.0976 2010 201977.2160 2303998.5024 developed 2005 1248.4416 10225.5552 2010 707.4816 7619.8528 forest / Wetlands 2005 26511.4304 69629.8624 2010 23433.7600 48124.4288 open land 2005 232290.1056 271714.9568 2010 45845.8112 131696.3200 other AG 2005 125527.1808 638010.4192 2010 257439.8848 635332.9024 soybean 2005 50799.1232 1791342.1568 2010 66271.2064 1811186.4512

Currently, 'land use' is organized alphabeticallyI want to put it in the following order:

  lst = ['openlands', 'one / lake', 'developed', 'corn', 'soybean', 'other ag']    

You can df = df.loc [lst] To reorder the index.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -