Accepted Method for Selecting a Validation Set in Python

Is there an accepted method for separating out a validation set in python? In R I would use the sample function. I have 4000 training instances as json and I want to save out a validation set. Should I just randomly pick indices and separate those out? Also is 30% of the training set a good size for the validation set?

I'm not fluent in Python so I'll stay out of code advices but for the percentage part, a 30% is a fairly standard ratio, as Andrew Ng points out in page 2 of the CS229 material for Model Selection, in http://cs229.stanford.edu/notes/cs229-notes5.pdf.

1. I don't think you'll get much advice on python code. I haven't seen much on this site.
2. Random sampling is almost always the correct approach. (If you have clustering or events recorded over time or at different locations - then other sampling techniques may have added benefit.
3. The issue of split sample has been addressed here a few times. Sample entries:
Splitting the dataset into Testing,Cross Validation and Training Set
Logistic regression performs better on validation data

Generally
-70/30 split commonly done. More traditional than anything. (though would be great if someone had a reference for this)
-Often sample size is inadequate to justify 70/30 split (see logistic regression... above).