POST
|
Thank you all for being so kind to take the time to reply. I'm working my way through your responses and already seeing some daylight. I'll post later when I get my head around this in a useful way. Doing a couple of simple scripts and work up from there.
... View more
03-09-2021
01:22 PM
|
0
|
0
|
1592
|
POST
|
Understanding Python dict Statement: I am new to Python, so forgive me if I’m asking questions about what should be obvious. If this is posted in the wrong place, my apologies: please let me know where I should be posting this. Using Python 2.7. I am re-using and modifying 2014 code that was written by Martjin Pieters and posted to StackOverflow [message 5268929]. It allows for the comparison of two CSV files, reporting on the differences between the master and host files. I thank him for this head start. I am comparing a file exported from ArcGIS using ArcPy. Here it is: 1 #2/3/2021 2 #Source: Stack Overflow "Compare two CSV files and search for similar items” 3 4 import csv 5 6 with open('masterlist.csv', 'rb') as master: 7 master_indicies = dics ((r[1], i) for i, r in enumerate(csv.reader(master))) 8 9 with open('hosts.csv', 'rb') as hosts: 10 with open('results.csv', 'wb') as results: 11 reader = csv.reader(hosts) 12 writer = csv.writer(results) 13 14 for row in reader: 15 index = master_indices.get(row[3]) 16 if index is not None: 17 message = 'FOUND in master list (row {})' .format(index) 18 else: 19 message = 'NOT FOUND in master list' 20 writer.writerrow(row + [message]) I sort of understand most of it save one section of line 7 shown in the figure below (though not sure I’ve parsed [the colors] the components correctly): The part highlighted in green is the one element of the dict entry I simply do not know how to read/interpret [what is ‘r’?; what is ‘i’ and what does ‘i) for i’ do; etc.]. If someone could point me to a place that I could learn about dict at an introductory level, hopefully with enough specificity that would help me to sort this out; that would be great. Just trying to get my head around this. Thank you very much.
... View more
03-07-2021
09:11 AM
|
0
|
6
|
1739
|
POST
|
Thanks to everyone for you help. i don't know how to thank you all. This problem has been around for awhile and - I'm sure you've figured this out - am still learning ArcPy. Be well. Stay safe.
... View more
02-01-2021
05:46 AM
|
1
|
0
|
3350
|
POST
|
This solved the problem. Bless you and thanks so very much for the advice!
... View more
02-01-2021
05:40 AM
|
1
|
0
|
3354
|
POST
|
The following is supposed to write the partial content of four Attribute Tables [AT] to a single CSV file. While it finishes “successfully”, it only writes the last of the four tables to the specified CSV file [MyOutput8.csv]. I had though that the statement arcpy.env.overwriteOutput=True on line 19 would address that but clearly I’m wrong. The CSV output looks like this, which is correct, except for the missing three AT’s that should precede it. Advice, please. Thank you so much.
... View more
01-31-2021
01:35 PM
|
0
|
8
|
3427
|
POST
|
Thanks very much. This solved that problem. Looks like I need some more time learning the details of Python. Be well, Bill Cole
... View more
01-17-2021
07:06 AM
|
0
|
0
|
2932
|
POST
|
This is for ArcGIS Desktop 10.8.1, Python 2.7. The purpose of this script is to examine Attribute Tables associated with a set of Feature Classes and to extract from those tables a set of fields, writing those fields to a single csv file. The following script threw the error “’None Type’ object is not iterable” that was flagged on Line 20, highlighted in the figure below. After reading several threads about None Type [here’s one from Geonet] I’ve decided that I’m just not smart enough to sort this out by myself nor have sufficient experience with Python to do so. Here’s what I’ve done to narrow things down: Ran a script to print out the FC’s that would be listed by line 12. This gave me the expected answer. Checked to make sure that the field names listed on line 26 were spelled and capitalized correctly. They were and were able to produce a csv file for a single FC. To get to this point, I’ve been the beneficiary of help from several Geonet denizens for which I am very grateful. I hate to keep asking and not giving, but here I am and would be grateful, yet again, for some suggestion or two about what I should be looking for to resolve this error.
... View more
01-15-2021
08:02 AM
|
0
|
2
|
2981
|
POST
|
Thank you again. I should have picked up on the need to make a new line but what do I know. Very much appreciate your patience and help. Be well. Bill Cole
... View more
01-13-2021
06:29 AM
|
1
|
0
|
1489
|
POST
|
Mr. Pike, thank you very much for your input. Obviously I still have much to learn about the Python/AcrPy world. Just to make sure that I understood your suggestions, below is a modified script, hopefully reflecting the changes you offered. Please let me know if I have made yet another mistake.
... View more
01-12-2021
07:22 AM
|
0
|
2
|
1498
|
POST
|
This is for ArcGIS 10.8.1 and Python 2.7 Using Blake Terhune’s solution [thank you, Blake] shown in the ESRI Community article Export Attribute Table to .csv as a basis to create a .csv file from the selected contents of an attribute table, I need to go one step further and modify that script so that it will cycle through a defined number of Attribute Tables within a defined .gdb. [Leaving the changes out, the script works fine for a single FC.] To do that I made these changes, which, it appears, to have been wrong. Here’s the modified script with the modifications highlighted in yellow: Modified CSV Script 1. I added line 12 which is intended to create a variable that extracts all FC’s that end with “03”. 2. Then modified line 15 so that that variable defined the array of input tables. 3. Finally added a for-loop as line 20 to cycle through those tables defined by line 15, outputting a – hopefully – concatenated .csv file containing all of the Attribute Table entries. This didn’t work as shown by this run-time result: ArcPy Error I checked to see if all the Fields defined in line 25 were spelled correctly – as I gotten a similar error when there was a problem with the field list – but they were all spelled and capitalized correctly. I would be grateful for some guidance on where I have gone wrong, please. Thanks so much,
... View more
01-11-2021
12:58 PM
|
0
|
4
|
1516
|
POST
|
I am looking for a hydrology tutorial for ArcGIS Desktop 10.8.x. I have used the Hydrologic analysis sample applications for ArcMap web page as a start, but find that there are missing pieces - parts that I don't understand - that I have not been able to sort out. I was hoping to find a tutorial like the excellent ArcGIS Spatial Analysis Extension Tutorial. Suggestions would be gratefully received. Thank you all very much, Bill Cole
... View more
09-19-2020
08:05 AM
|
0
|
0
|
762
|
POST
|
Checked w/Tech Support. Turns out that I was looking in the wrong place for the Proximity Tool Set. It is part of the Analysis group, while the instructions I was working with showed the Proximity Tool Kit as being in the first layer under Analysis Tools. My apologies.
... View more
06-23-2020
07:51 AM
|
1
|
0
|
763
|
POST
|
Thanks much for the information. In my install of Win10 I have to do *Control Panel | Apps | scroll to ArcGIS Desktop 10.8 | Uninstall | Repair | Install*. Sadly, that did not fix the problem so I guess I've got to call Tech. Bill Cole
... View more
06-23-2020
06:55 AM
|
0
|
0
|
763
|
Title | Kudos | Posted |
---|---|---|
1 | 02-01-2021 05:46 AM | |
1 | 02-01-2021 05:40 AM | |
1 | 01-13-2021 06:29 AM | |
1 | 02-08-2016 08:59 AM | |
1 | 06-05-2016 01:15 PM |
Online Status |
Offline
|
Date Last Visited |
yesterday
|