POST
|
Good day everybody, I am currently working with a feature class. I have a field with each cat that could be repeated around 100 or more times. However, I have 25 different cats. My task is to count how many times each cat appears in the field. Currently, I have a total number 40000 when I use "numbermyList = len(myList)" after my loop and only one when I use it in the loop. When I use "numbermyList = len(cat)", it gives the total number only for the first cat but not working the other cats.(If i use inside or outside of the loop) Could you please recommend to me how to use the loop to count the number of each cat in my field? Certainly, I would like to use the received number in my next loop, so I will receive something like this: 1st cat = 4000(numbermyList = len(myList)), 2sd cat 5000 and so on (numbermyList = len(myList)).
... View more
04-14-2021
05:57 AM
|
0
|
6
|
954
|
POST
|
I would like to use 'try 'and 'except' and check the module. Could you show how I can call this module from another script? The main reason is to use it as a module.
... View more
04-13-2021
01:33 AM
|
0
|
0
|
1454
|
POST
|
Yes, arcmap. I did but had the same error message. I only would like to check and print the list. I need a workable solution.
... View more
04-13-2021
01:09 AM
|
0
|
0
|
1458
|
POST
|
Yes, I have an error "Could not complete". I have checked the list works when I use it not in the module and give a pathway. I guess something wrong with "return" or somewhere where I call the list.
... View more
04-13-2021
12:47 AM
|
0
|
0
|
1463
|
POST
|
I am currently testing a function. Could you tell me how to make it works and how to use it as a module in another script?
... View more
04-12-2021
10:39 PM
|
0
|
9
|
1514
|
POST
|
Could you tell me how to copy (the information from one field) from one feature class to another feature class with application arcpy.SelectLayerByLocation with spatial join WITHIN? Any examples will be okay.
... View more
04-03-2021
10:32 PM
|
0
|
2
|
599
|
POST
|
Could you give any examples? I don't understand how to use everything together.
... View more
04-02-2021
06:22 PM
|
0
|
1
|
693
|
POST
|
Good day everybody, I have a task to add the missing information from one feature class table to another feature class table. I have a field in one table with the information about small areas that are partly there. However, I have another feature class table that consists of all information in one field, but this information represents big areas that consist of the small areas in my initial feature class table that I need. 1) I have created a feature layer that consists of all rows where there is no information in a particular field about the small areas in my feature class table. 2) I created a feature layer that combines all big areas. I would like to apply the spatial operator 'within' or 'intersect' to find the small areas within the big areas (using coordinates of the big areas and small areas) and add the missing information from the field there about the small areas in my feature class table in the particular field where I have my field with the partial information. I think to apply arcpy.da.UpdateCursor, arcpy.SearchCursor and probably 'select layer by location with the function 'within'. Could you tell me how I can use my feature layers to add the missing data in the field of my feature class table?
... View more
04-01-2021
11:12 PM
|
0
|
4
|
789
|
POST
|
Good day everybody. I am currently working with a file geodatabase. I created an additional field in a feature class table and want to add all the information from another field located in the same feature class table. I guess I can do it with arcpy.da.UpdateCursor but not sure how to copy from one field to another. Could you please give any advice?
... View more
04-01-2021
06:22 AM
|
0
|
2
|
522
|
POST
|
I would like to delete all txt files in my folder. Can you tell me why my code does not work? import os,shutil one = 'C:/1' two = os.listdir(one) number = 0 for aList in two: if os.path.isdir(aList): myDelete = shutil.rmtree('*txt', os.path.join(one, aList)) number += 1
... View more
03-21-2021
03:02 AM
|
0
|
2
|
582
|
POST
|
I see. Thank you. Your method deletes everything inside the files and replaces it for only 'Hellow'.
... View more
03-12-2021
04:47 AM
|
0
|
2
|
388
|
POST
|
I have corrected my script. I had an issue with 'workspace'. import arcpy inPut = r'C:\12' inPut = arcpy.env.workspace myList = arcpy.ListFiles() for fileName in myList: if fileName.endswith(".txt"): out = fileName[:-4] + ".txt" with open(out, "w") as k: k.write('Hellow') I have an error (line 10, in <module> for fileName in myList: TypeError: 'NoneType' object is not iterable)
... View more
03-12-2021
03:58 AM
|
0
|
5
|
1592
|
POST
|
Actually, it creates the copies of my file with 'Hellow' not in the folder where located the files but in the folder where my script located. Moreover, it deletes all additional information inside of the copied files. I have tried arcpy.ListFiles('*.txt'), but the result is the same.
... View more
03-12-2021
03:34 AM
|
0
|
0
|
1603
|
Online Status |
Offline
|
Date Last Visited |
07-30-2021
04:34 AM
|