+ Reply to Thread
Results 1 to 5 of 5

Thread: Question about Calculation answer in my field data?

  1. #1
    Michelle Couden
    Join Date
    Mar 2012
    Posts
    237
    Points
    0
    Answers Provided
    22


    0

    Default Question about Calculation answer in my field data?

    I wrote this python program and it works, but I have a question about the answer it gave me in the field. The answers should have been in decimal points (.0014657). It only did whole numbers like 0, 1 and so on. How do I get the table to fill with decimal point answers? Program below :

    import arcpy
    >>> import os.path
    >>> os.path.basename ("C:\Users\Michelle\Desktop\GIS\FA_Urbans.shp")
    'FA_Urbans.shp'
    >>> arcpy.AddField_management ("FA_Urbans","POPSQMI","LONG","30")
    <Result 'FA_Urbans'>
    >>> arcpy.CalculateField_management ("FA_Urbans","POPSQMI","!SQMI! / !FID_1!","PYTHON")
    <Result 'FA_Urbans'>
    >>>

  2. #2
    Darren Wiens

    Join Date
    Apr 2011
    Posts
    821
    Points
    271
    Answers Provided
    37


    0

    Default Re: Question about Calculation answer in my field data?

    From the help page,
    LONG —Numeric values without fractional values within a specific range.
    hint: use float or double.

  3. #3
    Michelle Couden
    Join Date
    Mar 2012
    Posts
    237
    Points
    0
    Answers Provided
    22


    0

    Default Re: Question about Calculation answer in my field data?

    Thanks for all your help, Darren!!

  4. #4
    Michelle Couden
    Join Date
    Mar 2012
    Posts
    237
    Points
    0
    Answers Provided
    22


    0

    Default Re: Question about Calculation answer in my field data?

    Hey Darren, Nope that didn't work. It still is doing whole numbers. Also, it won't accept my close().

  5. #5
    Anthony Timpson
    Join Date
    Sep 2011
    Posts
    90
    Points
    13
    Answers Provided
    4


    0

    Default Re: Question about Calculation answer in my field data?

    Michelle Please learn how to copy and paste code into the forums..

    seriously, have a little respect for the conventions and formats we all agree on here.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts