Q:

How to generate random points from FIDs using ArcPy or ArcGIS Field Calculator?

I'm trying to generate a shapefile of random points using FID from the attribute table.
My attribute table has 800,000 features and I only need a sample of 240.
Is there a way to do it in arcpy or in the field calculator?

A:

The easiest way to do this is to use Python (can be run in Python window in ArcMap if you are not familiar with any IDE or Python prompt):
import random
print random.sample(range(800000), 240)

This will give you a list of unique value (with no repeating), such as [1,2,5,12]. Now you can use the Select By Attributes in ArcMap and select the features which have their FIDs in the list (just copy/paste the contents of the list):
FID in (1,2,5,12)

Right-click the layer in the TOC and choose Export data. Only selected features will be exported into a new shapefile.

