title: Creating a numpy array and then sorting array
body: <p>I have been encountering a problem that I can't seem to solve I need to take a list of strings and calculate some values and then add the relevant string and the relevant integer to a numpy array. I've been told to create the numpy array of zeroes first as it will be of a known length so I can do that. My problem is how do I iteratively add each string to the first column (names) and each value (labels) to the second and then sort the full array alphabetically by the first column</p>
  
  <pre><code>fileCount = sum([len(files) for r, d, files in os.walk(inputDirectory)])
  labelArray = np.zeros(shape = (fileCount,2))
  arrayInsertCounter = 0
  
  for label, subDirectories in enumerate(inputDirectory):
  
    subDirPath = os.path.join(inputDirectory, subDirectories)
  
    for name in subDirPath:
  
      labelArray[arrayInsertCounter] = [name,label]
      arrayInsertCounter += 1
  </code></pre>