Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import arcpy
  2. import pandas as pd
  3. import numpy as np
  4.  
  5. raster = r"X:RGBraster3.tif" #Change
  6. out_excel = r"X:RGBexcel.xlsx" #Change
  7.  
  8. arr = arcpy.RasterToNumPyArray(raster)
  9.  
  10. with pd.ExcelWriter(out_excel) as writer:
  11. for colorband in range(3):
  12. df = pd.DataFrame(arr[colorband])
  13. df.to_excel(writer,sheet_name='Band_{0}'.format(colorband), header=False, index=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement