|
POST
|
You'd need to increase the indent, and construct the list, but yes, this simple bit of code could be added anywhere. Your code above would work if you format it correctly for the Field Calculator, but it's wasteful -- Why assemble a new list just to compile a sum? (It's an order of magnitude more work, and of O(n^2) complexity). Please be sure to include all critical details in the initial question (use of Field Calculator, for example), since changing the question in follow-ups will reduce the value of answers to those who search for the same question. - V
... View more
07-07-2017
07:32 AM
|
1
|
0
|
2632
|
|
POST
|
The mean of a sample population is the sum divided by the count. The "count" is of the non-NULL values. All you need is a mechanism to sum values, incrementing the count for each value summed. sum = 0.0
count = 0
for elem in array:
if elem:
sum += elem
count += 1
if (count > 0):
print("Mean = {:.2f}".format(sum / float(count)))
else:
print("Mean undefined!") This would be easily adapted to a DA Cursor, since a row is an array.
... View more
07-07-2017
06:54 AM
|
1
|
7
|
2632
|
|
POST
|
At the risk of further tarnishing my reputation as an expert of all things GIS, "I got nuthin'." -V
... View more
07-06-2017
06:25 AM
|
0
|
0
|
2144
|
|
POST
|
Again, it depends. Generally, a group with multiple files within one filesystem encourages fragmentation, but it depends on whether the blocks are being allocated round-robin or "fill one first". - V
... View more
06-27-2017
12:22 PM
|
0
|
0
|
2789
|
|
POST
|
The purpose for filegroups (back when Sybase created them in the mists of time) was to distribute data across devices within one container of the RDBMS. At the time, disk volumes were tiny (50Mb-200Mb on a workstation, 900Mb on a server), so "large" tables (1-2Gb) required multiple devices. Database admins would spend days and weeks organizing the striping for data and indexes across volumes in order to get optimal performance. Given the size of modern devices, where the controller cache is measured in gigabytes, and the block sizes may be 64-256k, and the device itself is composed of clusters of NVRAM with submillisecond seek time, the purpose of filegroup use has languished in significance, to the point that it may not matter. It doesn't yet make sense for the RDBMS provider to remove the capability, but it certainly won't be emphasized in vendor training. More often than not, customizing filegroups will only encourage fragmentation, hurting overall performance. Let's say you create ten data files on two independent disks (five each) for ONE large table. If the database is adding rows to block groups in round-robin order, then subsequent pages are likely to be 1/5th of the device storage away from each other, causing increased access latency over two files (one per disk). When you take auto-growth in file allocation and volume optimization into account, you're completely at the mercy of load order and lack of file defragmentation. This is likely why PostgreSQL has abandoned RDBMS control over disk access, and just uses the filesystem as-is, with a "tablespace" only being a mount point for the data to be written, and relying on defragmentation for the rest. However, if you have TEN small tables, accessed somewhat independently, as in the documentation you referenced, then you might get a benefit, if the data files aren't too fragmented. Unfortunately, the best way to tell if that optimization technique works in your context is to try two or more different configurations and decide if the difference is worth the effort of altering the DBTUNE. If you don't want to do the testing yourself, then using the recommended configuration should probably be the default. - V
... View more
06-27-2017
10:28 AM
|
1
|
2
|
2789
|
|
POST
|
Please use the "Mark Correct", "Helpful", and "Like" buttons in lieu of adding records to the database with thanks. - V
... View more
06-23-2017
11:30 AM
|
2
|
0
|
3727
|
|
POST
|
Any of the PG 9.4.x releases (where x >= 5) are supported with ArcGIS 10.4.1. Only 9.4.5 was certified.
... View more
06-23-2017
11:00 AM
|
0
|
2
|
3727
|
|
POST
|
Please ask a new question instead of adding on to an existing thread with a different environment. As stated in this thread, it's always critical to specify, in the question, the exact release of the database to which you are connecting.
... View more
06-23-2017
07:22 AM
|
0
|
0
|
703
|
|
POST
|
It's my understanding that there are two ways to invoke Python; for lack of better terms, I'll call them "script" and "immediate". The field calculator submits a string to the parser in "immediate" mode, but because it's not a file, you get more generic errors (and sometimes it's just "error occurred"). Python toolboxes have a .pyt suffix, so .cal isn't the only quirky suffix for Python-like code. I expect the UTF-16 encoding is due to the default character width in the Windows app, and avoiding the need to translate to UTF-8 before submitting to the parser. I've been programming since I was 12, so I'll stay out of the debate on how to teach non-programmers scripting languages. - V
... View more
06-22-2017
07:53 AM
|
1
|
1
|
5090
|
|
IDEA
|
Shapefiles are actually based on dBase III+, not IV, though ArcGIS doesn't use a strict interpretation, since 255 fields are permitted, even though the specification limits dBase III to 100 fields. "dBase III+-ish" might be a better name for it. My understanding is that the problem with Microsoft Access-based Personal GDB support is the limited functionality provided by 64-bit Access libraries (Pro is a 64-bit app, so 64-bit libraries are needed). "Do not scale well" doesn't mean "It's a bit slow" or "It's kinda slow"; it's closer to "It's so slow, my grandchildren will need to see if the build verification script ever finished." If Esri were able to get an improved 64-bit Access library which was "only" four times slower than 32-bit access on the same host, and then added it to Pro, would you thank them for giving you a chance to evaluate it, or file bug reports about the performance? - V
... View more
06-16-2017
09:38 AM
|
8
|
2
|
12618
|
|
POST
|
It's not that thanks aren't welcome, but they do clog up the database in a way that marking things as Helpful or using the Like button do not, so please use those mechanisms instead. I'd recommend giving the Correct to Dan, who answered both parts of the question; I was just seconding his recommendation. - V
... View more
06-08-2017
08:46 AM
|
3
|
0
|
7190
|
|
POST
|
Yes, I agree that GeoTIFF is certainly the the best way forward here. Grid is far too complicated to send correctly, and is much less likely to be supported. - V
... View more
06-08-2017
06:55 AM
|
1
|
2
|
7190
|
|
POST
|
It depends on what you're trying to do, and how far apart the releases are, and which product is newer. Generally a newer Desktop client will be able to interact with an older server instance, provided it isn't too old. The documentation includes compatibility matrix tables; the 10.5 doc includes this FAQ. Keep in mind that significant implementation changes were made between ArcGIS 10.0sp5 and 10.1.0, so ArcGIS 10.1 is likely to be the limit of reverse compatibility.
... View more
06-07-2017
01:00 PM
|
1
|
0
|
3225
|
|
POST
|
The error indicates that the source shape is also NULL (or empty). Joshua asked about the shape contents, not the target fields. You can add a "if (row[0] and row[1]):" above your row assignment to prevent the error, with an else to report trouble. - V
... View more
06-05-2017
06:56 AM
|
0
|
0
|
1784
|
|
POST
|
Please stop using ALL CAPS in your question titles. If you think it's a way to attract interest, I can assure you that it's in fact driving away potential viewers. - V
... View more
06-02-2017
07:20 AM
|
1
|
0
|
1130
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 2 | 06-08-2026 09:13 PM | |
| 1 | 05-29-2026 12:51 PM | |
| 1 | 06-01-2026 06:03 PM | |
| 2 | 05-29-2026 08:31 AM |