Calculating acreage as a percentage in ArcPyUse VB to calculate an area of a shapeWhat is the syntax for...

Does "Dominei" mean something?

What is the term when two people sing in harmony, but they aren't singing the same notes?

What is the opposite of 'gravitas'?

Invariance of results when scaling explanatory variables in logistic regression, is there a proof?

Is a naturally all "male" species possible?

Word describing multiple paths to the same abstract outcome

What if somebody invests in my application?

Simple image editor tool to draw a simple box/rectangle in an existing image

How to prevent YouTube from showing already watched videos?

Freedom of speech and where it applies

Could solar power be utilized and substitute coal in the 19th century?

Are Warlocks Arcane or Divine?

Stereotypical names

How do I rename a LINUX host without needing to reboot for the rename to take effect?

Should my PhD thesis be submitted under my legal name?

How do I repair my stair bannister?

Java - What do constructor type arguments mean when placed *before* the type?

Indicating multiple different modes of speech (fantasy language or telepathy)

Is there a good way to store credentials outside of a password manager?

Who must act to prevent Brexit on March 29th?

How can a jailer prevent the Forge Cleric's Artisan's Blessing from being used?

How to color a zone in Tikz

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?

Bob has never been a M before



Calculating acreage as a percentage in ArcPy


Use VB to calculate an area of a shapeWhat is the syntax for Python 2.7 to permanent display in percent in a field column?ERROR 000989 Issue with Python Script and Field Calculating distance between two long lat pointsCalculating centroid latitude in ArcMap throws error 000539 in Arcpy?Sum field and use that sum to populate existing field in same table using ArcGIS ModelBuilder?Setting input parameter to be float for Python script tool?Using ouput data variables in subsequent calculation within ArcGIS ModelBuilder?Calculating Field Chosen by arcpy.GetParameterAsText(1) gives ERROR 000539?ArcGIS Field Calculator returning error 000989?Calculating Polsby-Popper Score Using ArcGIS Pro Field Calculator gives ERROR 000539?













0















I am struggling to calculate the acreage as a percentage in Calculate Field Management, but I am getting this error message:




"ValueError: could not convert string to float! BufferAcreage!




arcpy.CalculateField_management(fc, "BuffAcreage", "!shape.area@acres!", "PYTHON", "")

arcpy.CalculateField_management(fc, "BuffPct", float("!BufferAcreage!")/float("!Acres_Whole!") * 100, "PYTHON", "")


The initial line of code works perfectly, but it is the second line of code when I am calculating the acreage percentage that I run into the error.



It will not calculate the field because for some reason it is telling me that I am treating the values in these attributes as strings and will not convert them to floats.



It must be done with the arcpy.CalculateField_management(). I can not use an alternative python scripting method because the assignment directions stipulated that I must use the Calculate Field tool in my script. Any suggestions?










share|improve this question









New contributor




tjwashin234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I am struggling to calculate the acreage as a percentage in Calculate Field Management, but I am getting this error message:




    "ValueError: could not convert string to float! BufferAcreage!




    arcpy.CalculateField_management(fc, "BuffAcreage", "!shape.area@acres!", "PYTHON", "")

    arcpy.CalculateField_management(fc, "BuffPct", float("!BufferAcreage!")/float("!Acres_Whole!") * 100, "PYTHON", "")


    The initial line of code works perfectly, but it is the second line of code when I am calculating the acreage percentage that I run into the error.



    It will not calculate the field because for some reason it is telling me that I am treating the values in these attributes as strings and will not convert them to floats.



    It must be done with the arcpy.CalculateField_management(). I can not use an alternative python scripting method because the assignment directions stipulated that I must use the Calculate Field tool in my script. Any suggestions?










    share|improve this question









    New contributor




    tjwashin234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I am struggling to calculate the acreage as a percentage in Calculate Field Management, but I am getting this error message:




      "ValueError: could not convert string to float! BufferAcreage!




      arcpy.CalculateField_management(fc, "BuffAcreage", "!shape.area@acres!", "PYTHON", "")

      arcpy.CalculateField_management(fc, "BuffPct", float("!BufferAcreage!")/float("!Acres_Whole!") * 100, "PYTHON", "")


      The initial line of code works perfectly, but it is the second line of code when I am calculating the acreage percentage that I run into the error.



      It will not calculate the field because for some reason it is telling me that I am treating the values in these attributes as strings and will not convert them to floats.



      It must be done with the arcpy.CalculateField_management(). I can not use an alternative python scripting method because the assignment directions stipulated that I must use the Calculate Field tool in my script. Any suggestions?










      share|improve this question









      New contributor




      tjwashin234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am struggling to calculate the acreage as a percentage in Calculate Field Management, but I am getting this error message:




      "ValueError: could not convert string to float! BufferAcreage!




      arcpy.CalculateField_management(fc, "BuffAcreage", "!shape.area@acres!", "PYTHON", "")

      arcpy.CalculateField_management(fc, "BuffPct", float("!BufferAcreage!")/float("!Acres_Whole!") * 100, "PYTHON", "")


      The initial line of code works perfectly, but it is the second line of code when I am calculating the acreage percentage that I run into the error.



      It will not calculate the field because for some reason it is telling me that I am treating the values in these attributes as strings and will not convert them to floats.



      It must be done with the arcpy.CalculateField_management(). I can not use an alternative python scripting method because the assignment directions stipulated that I must use the Calculate Field tool in my script. Any suggestions?







      arcpy field-calculator calculate-values






      share|improve this question









      New contributor




      tjwashin234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      tjwashin234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 7 mins ago









      Taras

      2,3112727




      2,3112727






      New contributor




      tjwashin234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 11 mins ago









      tjwashin234tjwashin234

      11




      11




      New contributor




      tjwashin234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      tjwashin234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      tjwashin234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          tjwashin234 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f316680%2fcalculating-acreage-as-a-percentage-in-arcpy%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          tjwashin234 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          tjwashin234 is a new contributor. Be nice, and check out our Code of Conduct.













          tjwashin234 is a new contributor. Be nice, and check out our Code of Conduct.












          tjwashin234 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f316680%2fcalculating-acreage-as-a-percentage-in-arcpy%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

          Meter-Bus Содержание Параметры шины | Стандартизация |...