Module 4: Explore & Manipulate Data

This lab’s script created a new geodatabase, put data into it, and populated a dictionary with county names and populations. I got the beginning lines of the script and the geodatabase created easily which was nice. Below are screen shots of my script results.

Creating the for loop to copy all the features to the new geodatabase was a bit harder. I struggled with using the basename property of the Describe(). Eventually, I figured that part out by going over the readings again. I also looked at some example codes online.

The two tasks I had the most trouble with were the Search Cursor and populating the dictionary. Even after doing all the readings and completing the lab I’m still not sure I fully understand the cursors. Once I got the cursor code to run getting it to print correctly was interesting. At first, I had it all in one print statement. I did not realize I needed .format(row[#]) after every section. Further, that the index number needed to be changed.

I got the basics of the populate dictionary section set up relatively easily. I kept getting the error of tuples not having an attribute row.getValue(). I was using the Canvas discussion board for help on this section and saw other were using the row.getValue(). This did not work for me. I ended up setting my variables in the for loop equal to row[#]. This worked fine and the dictionary populated successfully. This lab was one of the hardest ones. Sometimes there came a point where I didn’t know what to try next after attempting to fix an error multiple time. This is probably because of my lack of Python experience. I usually ended up coming back to it later.








Comments