Select to view content in your preferred language

How to collect the outputs in a scripts python for arcgis ?

1685
11
Jump to solution
06-05-2018 08:22 AM
paulbonnard
Occasional Contributor

Hi everybody,

I just begin to work with argis and after a long and hard work for loading the arcpy module, i face a new problem.

I'm sure it is pretty simple but i do not have all the habits yet.

I have to make a script in python, in the script the user gives the number of variables and all the weights of these variables and the script return the new weight of these variables normalised.

  • Example, 2 variables that have the weight 2 and 4 and the script return 2/6 and 4/6

The code is easy, i use arcpy.GetParameter to get Var_Number but i dont know how to iterate on it, and how to return the new weight.

Thank you for reading me.

here is my code 

0 Kudos
11 Replies
paulbonnard
Occasional Contributor

Ok thank you a lot for your answer, i just need to see it.

In fact my my tool will have to take a raster, (if i understood correctly, a raster is just a matrix) in this raster we have several variables represented by different number. We give a weight to each variables and we change it by the weight normalized.

And finally it return the raster with the weight normalised in each cases of the raster.

Then maybe i will think about putting several raster in input. 

i'm going to look for how to convert a raster input in numpy data and begin to make the code, I probably need you later Dan if you are still ok haha

0 Kudos
DanPatterson_Retired
MVP Emeritus

Check out RasterToNumPyArray... and I have lots of examples on my blog