I am trying to figure out how to do several calculations through python and the arcpy set. I have an large dataset (7+ million records of individuals), and I am trying to code a value of 1 that denotes if the individuals are married.
Now I do not have marriage status, but I might be able to get it through following through this logic...
- I have last name and address, I can create a new field that has this new identifier and determine if more than one person with the same last name lives at that address.
- I have Age, so I could subtract the highest value from the second highest value to get the difference, and if that difference is say less than 15 years, assume they are married.
- I do not have gender, but I do have first name. I have a large dataset of first names to determine gender, but there are too many names that are for both men and women, and I want to stay away from this as this process will be too involved.
So I can create the new field easy through update cursor. I dissolve it and join it back to the data set to get the number of people with eh same last name at an address. But after this, I am running into the my issues.
I would like to subtract the largest number that has the same id field, from the second highest number. But I am not sure how to write/code that in python to run it in ArcGIS. Is this even the best solution to solving this problem? I am welcome to all suggestions to help me get through this problem!!!!