<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div>
<div>
<div dir="ltr" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Hello Scott,</div>
<div dir="ltr" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div dir="ltr" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
While I’ll be able to take a crack at this later in the week, (I’m also brushing up on Python for similar purposes) one way to approach this would be through ArcPy’s “arcpy.da.SearchCursor” and “arcpy.da.UpdateCursor”. These classes a<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">llow
Python to “look” at and modify your attribute table values, respectively, within ArcMap. </span><span style="">Another way is through importing the table into a pandas dataframe and manipulating it from there... but ArcPy's capability to operate seamlessly
w/n ArcMap is worth skipping over that learning curve.</span></div>
<div dir="ltr" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;"><br>
</span></div>
<div dir="ltr" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">I hope that’s a good starter for now. Will e-mail direct with a more concrete solution when time permits. </span></div>
<div dir="ltr" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;"><br>
</span></div>
<div dir="ltr" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); display: inline !important;">Cheers,</span></div>
</div>
<div id="ms-outlook-mobile-signature">
<div><br>
</div>
<div style="direction:ltr">Nathaniel Countess</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size: 11pt;"><b>From:</b> SHRUG-L <shrug-l-bounces@lists.dep.state.fl.us> on behalf of Scott Crosby <scrosby@alachuacounty.us><br>
<b>Sent:</b> Tuesday, September 7, 2021 12:08:11 PM<br>
<b>To:</b> SHRUG-L@lists.dep.state.fl.us <SHRUG-L@lists.dep.state.fl.us><br>
<b>Subject:</b> shrug-l: Creating an If/Then Python script, ArcMap 10.7</font>
<div> </div>
</div>
<div lang="EN-US">
<div class="x_WordSection1">
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
Hi all,</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
I need to create a Python script that will change the values of one field based on the values of another field. In a nutshell, I want a Field called “Fire Type” to change to a yes, no or maybe, based on the values in another field called “Name_State” where
this will happen:</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
Name State = mesic flatwoods, or sandhill, or wet flatwoods, or pasture, or semi-improved pasture; then</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
Fire type = Yes</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
AND</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
Name State = (non-pyric natural community); then</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
Fire Type = No</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
AND</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
Name State = Basin marsh, or depression marsh, or dome swamp; then</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
Fire Type = Maybe</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
It’s been a while since I’ve dealt with Python, so any help anyone can provide would be greatly appreciated.</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
</p>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
Thanks,</p>
<table class="x_MsoNormalTable" border="0" cellspacing="3" cellpadding="0" width="668" style="width:501.0pt">
<tbody>
<tr style="height:18.75pt">
<td width="108" style="width:81.0pt; padding:.75pt .75pt .75pt .75pt; height:18.75pt">
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<a href="https://urldefense.com/v3/__http://www.alachuacounty.us/Pages/AlachuaCounty.aspx__;!!Epnw_ITfSMW4!_Vj9X0JLJQ54HKJa6odQH5OnZ_VSrDFGd5XgMi1yIdXvwY47ZEicAddLpzrRjzk3IA$" title="Alachua County Fire Rescue website"><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(5, 99, 193); text-decoration: none;"><img border="0" width="100" height="100" id="x_Picture_x0020_1" alt="cid:image001.png@01D7A3E0.C6D33050" style="width:1.0416in; height:1.0416in" data-outlook-trace="F:1|T:1" src="cid:image001.png@01D7A3E0.C6D33050"></span></a><span style="font-size:10.0pt; font-family:"Arial",sans-serif"></span></p>
</td>
<td width="551" style="width:413.25pt; padding:.75pt .75pt .75pt .75pt; height:18.75pt">
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<strong><span style="font-size:10.0pt; font-family:"Arial",sans-serif">Scott Crosby, SAF Certified Forester
</span></strong><span style="font-size:8.0pt; font-family:"Arial",sans-serif"><br>
Senior Environmental Specialist<br>
Environmental Protection<br>
408 W. University Ave Suite 106 • Gainesville • FL • 32601<br>
352-264-6823 (office) • 352-213-0024 (mobile)<br>
</span><a href="https://urldefense.com/v3/__http://www.alachuacounty.us/Pages/AlachuaCounty.aspx__;!!Epnw_ITfSMW4!_Vj9X0JLJQ54HKJa6odQH5OnZ_VSrDFGd5XgMi1yIdXvwY47ZEicAddLpzrRjzk3IA$"><span style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(5, 99, 193); text-decoration: none;"><img border="0" width="28" height="35" id="x_Picture_x0020_2" alt="cid:image002.png@01D7A3E0.C6D33050" style="width:.2916in; height:.3645in" data-outlook-trace="F:1|T:1" src="cid:image002.png@01D7A3E0.C6D33050"></span></a><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span><a href="https://urldefense.com/v3/__https://www.facebook.com/AlachuaCounty/__;!!Epnw_ITfSMW4!_Vj9X0JLJQ54HKJa6odQH5OnZ_VSrDFGd5XgMi1yIdXvwY47ZEicAddLpzpWpdnFsQ$"><span style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(5, 99, 193); text-decoration: none;"><img border="0" width="28" height="28" id="x_Picture_x0020_3" alt="cid:image003.png@01D7A3E0.C6D33050" style="width:.2916in; height:.2916in" data-outlook-trace="F:1|T:1" src="cid:image003.png@01D7A3E0.C6D33050"></span></a><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span><a href="https://urldefense.com/v3/__https://twitter.com/alachuacounty__;!!Epnw_ITfSMW4!_Vj9X0JLJQ54HKJa6odQH5OnZ_VSrDFGd5XgMi1yIdXvwY47ZEicAddLpzrqwtYZMQ$"><span style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(5, 99, 193); text-decoration: none;"><img border="0" width="28" height="28" id="x_Picture_x0020_4" alt="cid:image004.png@01D7A3E0.C6D33050" style="width:.2916in; height:.2916in" data-outlook-trace="F:1|T:1" src="cid:image004.png@01D7A3E0.C6D33050"></span></a><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span><a href="https://urldefense.com/v3/__https://www.instagram.com/alachuacounty/__;!!Epnw_ITfSMW4!_Vj9X0JLJQ54HKJa6odQH5OnZ_VSrDFGd5XgMi1yIdXvwY47ZEicAddLpzqgvYqrcg$"><span style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(5, 99, 193); text-decoration: none;"><img border="0" width="28" height="28" id="x_Picture_x0020_5" alt="cid:image005.png@01D7A3E0.C6D33050" style="width:.2916in; height:.2916in" data-outlook-trace="F:1|T:1" src="cid:image005.png@01D7A3E0.C6D33050"></span></a><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span><a href="https://urldefense.com/v3/__https://www.youtube.com/user/alachuacounty__;!!Epnw_ITfSMW4!_Vj9X0JLJQ54HKJa6odQH5OnZ_VSrDFGd5XgMi1yIdXvwY47ZEicAddLpzp3QiE36Q$"><span style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(5, 99, 193); text-decoration: none;"><img border="0" width="28" height="28" id="x_Picture_x0020_6" alt="cid:image006.jpg@01D7A3E0.C6D33050" style="width:.2916in; height:.2916in" data-outlook-trace="F:1|T:1" src="cid:image006.jpg@01D7A3E0.C6D33050"></span></a><span style="font-size:10.0pt; font-family:"Arial",sans-serif">
</span><a href="https://urldefense.com/v3/__http://www.alachuacounty.us/depts/communications/pages/updatenewsletter.aspx__;!!Epnw_ITfSMW4!_Vj9X0JLJQ54HKJa6odQH5OnZ_VSrDFGd5XgMi1yIdXvwY47ZEicAddLpzqouyjwmw$"><span style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(5, 99, 193); text-decoration: none;"><img border="0" width="28" height="28" id="x_Picture_x0020_7" alt="cid:image007.png@01D7A3E0.C6D33050" style="width:.2916in; height:.2916in" data-outlook-trace="F:1|T:1" src="cid:image007.png@01D7A3E0.C6D33050"></span></a><span style="font-size:10.0pt; font-family:"Arial",sans-serif"></span></p>
</td>
</tr>
<tr style="height:18.75pt">
<td colspan="2" valign="top" style="padding:.75pt .75pt .75pt .75pt; height:18.75pt">
<p><span style="font-size:8.0pt; font-family:"Arial",sans-serif">PLEASE NOTE: Florida has a very broad public records law (F.S.119).<br>
All e-mails to and from County Officials and County Staff are kept as public records. Your e-mail
<br>
communications, including your e-mail address, may be disclosed to the public and media at any time.</span><span style="font-size:10.0pt; font-family:"Arial",sans-serif"></span></p>
</td>
</tr>
</tbody>
</table>
<p class="x_MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
</p>
</div>
</div>
</body>
</html>