title: How to select the datas which has 'train' as its datatype in dataframe pandas?
body: <p>I have a dataframe like this:</p>
  
  <pre><code>                             0                 1                 2
  filename     CF02_B1_D1_M3.wav  F02_B2_D1_M2.wav  F02_B3_D6_M3.wav   
  datatype                 train             train              test   
  label                        1                 1                 6   
  feature0               18.2796           17.8995           18.0531   
  feature1              -3.92135          -15.5039          -31.0344   
  feature2               13.6118         -0.741729           7.87929   
  feature3              -7.25019        -0.0536188          -18.6119   
  feature4              -11.7736          -6.73465          0.682173   
  feature5               -18.265           4.39842           -5.3771   
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>from python_speech_features import mfcc
  import scipy.io.wavfile as wav
  import numpy as np
  import os
  import pandas as pd
  
  filenames, datatype, labels = [], [], []
  fitur = [[] for i in range(2392)]
  path = "C:\Users\HEWLETT PACKARD"
  for item in os.listdir(path):
      if item.endswith('.wav'):
          parts = item.split('_')
          (rate, sig) = wav.read(item)
          mfcc_feat = mfcc(sig, rate, nfilt=26, numcep=13)
          feat = np.asarray(mfcc_feat[:, :])
          feature = feat.ravel()
  
          if parts[1][1] == '3': 
              data_type='test'
              label=parts[2][1]
          else:
              data_type='train'
              label=parts[2][1]
  
          filenames.append(item)
          datatype.append(data_type)
          labels.append(label)
          for i in range(2392):
              fitur[i].append(np.squeeze(feature[i]))
  
  dataset = [filenames, datatype, labels]
  dataset.extend(fitur)
  column = ['filename', 'datatype', 'label']
  column.extend(['feature'+str(i) for i in range(2392)])
  dataset = [(col, val) for col, val in zip(column, dataset)]
  df = pd.DataFrame.from_items(dataset, columns = column)
  
  df = df.transpose()
  print df
  </code></pre>
  
  <p>I extracted the features of some wav files. I divided them into train and test datas. Then I put them into one dataframe.
  How to select the datas which has 'train' as its datatype?</p>