(self, num_samples)
return pitch_counter
Returns pitch_counter for num_samples for given dataset.
Returns pitch_counter for num_samples for given dataset.
Returns pitch_counter for num_samples for given dataset .
def get_pitches(self, num_samples):
    """Returns pitch_counter for num_samples for given dataset."""
    all_pitches = []
    pitch_counts = self.get_pitch_counts()
    for k, v in pitch_counts.items():
      all_pitches.extend([k]*v)
    sample_pitches = np.random.choice(all_pitches, num_samples)
    pitch_counter = Counter(sample_pitches)
    return pitch_counter
def get_pitches ( self , num_samples ) : all_pitches = [ ] pitch_counts = self . get_pitch_counts ( ) for k , v in pitch_counts . items ( ) : all_pitches . extend ( [ k ] * v ) sample_pitches = np . random . choice ( all_pitches , num_samples ) pitch_counter = Counter ( sample_pitches ) return pitch_counter