title: Deduplicating dataframe causes issues with splitting dataframe
body: <p>I have a function to split a dataset into training and test sets:</p>
  
  <pre><code>def train_test_split(df, train_percent=.7, seed=None):
      np.random.seed(seed)
      perm = np.random.permutation(df.index)
      m = len(df.index)
      train_end = int(train_percent * m)
      train = df.iloc[perm[:train_end]]
      test = df.iloc[perm[train_end:]]
      return train, test
  </code></pre>
  
  <p>It works fine on a dataframe that is <code>249681 rows × 9 columns</code></p>
  
  <p>Of these, I decided to drop 4 columns because of too many missing values:</p>
  
  <pre><code>df_subset_dup = df_encode.iloc[:,:5]
  df_subset = df_subset_dup.drop_duplicates()
  </code></pre>
  
  <p>After that, when I do <code>df_trainRaw4, df_testRaw4 = train_test_split(df_subset)</code>, I get <code>IndexError: positional indexers are out-of-bounds</code>. However, doing <code>df_trainRaw4, df_testRaw4 = train_test_split(df_subset_dup)</code> returns no errors. </p>
  
  <p>What am I doing with <code>drop_duplicates</code> that's causing the error and how do I rectify it?</p>