I have a shape file of all the counties in the United States and data from the 208-2016 United States Presidential Elections. I am trying to join the data so that when I click on the county name, the results for the election will show. I have tried joining by the FIPS code but that doesn't help.
Here is the data if you think you can help me:
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">classify</SPAN><SPAN class="punctuation token">(</SPAN>val<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">""" """</SPAN> <SPAN class="keyword token">if</SPAN> val <SPAN class="operator token"><</SPAN> <SPAN class="number token">25000</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">'A'</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="number token">25000</SPAN> <SPAN class="operator token"><=</SPAN> val <SPAN class="operator token"><=</SPAN> <SPAN class="number token">50000</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">'B'</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">'C'</SPAN> vals <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="number token">24000</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">49000</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">100000</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="punctuation token">[</SPAN>classify<SPAN class="punctuation token">(</SPAN>val<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">for</SPAN> val <SPAN class="keyword token">in</SPAN> vals<SPAN class="punctuation token">]</SPAN> Out<SPAN class="punctuation token">[</SPAN><SPAN class="number token">76</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'A'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'B'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'C'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
if you don't want to symbolize, you can reclassify
Add a text field
'classify' is your code block (change thresholds and return values as appropriate)
python parser
call you function using
classify(!YourFieldName!)
in the expression... obviously keep the ! marks and just change the fieldname
Drawing features to show quantity by category—Help | ArcGIS Desktop
Symbolization—ArcGIS Pro | ArcGIS Desktop
I am using the 2010 population as a benchmark for whether a county is rural (2,499 or less), suburban (2500-49,999) and urban (50,000 or more). Is there a way in ARCGIS to make a formula that will automatically divide the counties up?
Ditch the csv and use real tables in a file geodatabase.
Thank you for your help. I have tried numerous ways but I can't get the join to work. Do you still have the file?
Thanks for your help.
FYI -- Tip --
For those of you who do not know -- The first 8 Rows of an excel spreadsheet determines the datatype... so if you have rows of number but have one blank or text character within the first eight rows that column will be treated as text....in esri ...
The Excel sheet name in your screenshot and the one attached to your original post, don't seem to be the same.
Anyway, as Dan mentioned, you need to make sure the fields you are joining, should have the same Data Type. The Esri Counties data, has FIPS as String(Text), however the one in the excel you show in the screenshot has Long Int. So that join won't work.
I added a new Column in the Counties Shapefile, FIPS_Num, populated the FIPS code in it from the existing FIPS Code field and that allows the join.
I got a screenshot. I am trying to link the United States Counties layer and the election results (either csv 1 or 2). Both layers have the fips codes and county names.
rather than post the large files, perhaps you can just do a screen grab of the two tables that show the fields you are trying to use in the join.
Covers most problems when people are trying to formulate joins
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.