title: Load specific PyYAML documents from file
body: <p>I have a <code>.yml</code> file, and I'm trying to load certain documents from it. I know that:</p>
  
  <pre><code>print yaml.load(open('doc_to_open.yml', 'r+'))
  </code></pre>
  
  <p>will open the first (or only) document in a <code>.yml</code> file, and that:</p>
  
  <pre><code>for x in yaml.load_all(open('doc_to_open.yml', 'r+')):
      print x
  </code></pre>
  
  <p>which will print all the YAML documents in the file. But say I just want to open the first three documents in the file, or want to open the 8th document in the file. How would I do that?</p>