Created
June 24, 2016 20:05
-
-
Save ryan-hill/fdcf3d4c0dcb201cfc6d47fc37f6af78 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import numpy as np | |
import pandas as pd | |
#Read in .csv file | |
nlcd = pd.read_csv('NLCD2011_FINAL.csv') | |
#Select desired columns - selects 1st column and then 23rd column to end | |
nlcd = nlcd.iloc[:, np.r_[:1, 23:len(nlcd.columns)]] | |
#Strip out 'Ws' string from column names that contain it | |
newnames = [w.replace('Ws', '') for w in nlcd.columns] | |
#rename columns | |
nlcd.columns = newnames |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment