def sort opts={}, &block
      opts = {ascending: true}.merge(opts)

      vector_index = resort_index(@data.each_with_index, opts, &block)
      vector, index = vector_index.transpose

      index = @index.reorder index

      Daru::Vector.new(vector, index: index, name: @name, dtype: @dtype)
    end
def sort opts={}, &block
      opts = {ascending: true}.merge(opts)

      vector_index = resort_index(@data.each_with_index, opts, &block)
      vector, index = vector_index.transpose

      index = @index.reorder index

      Daru::Vector.new(vector, index: index, name: @name, dtype: @dtype)
    end
Sorts a vector according to its values. If a block is specified, the contents
 will be evaluated and data will be swapped whenever the block evaluates
 to *true*. Defaults to ascending order sorting. Any missing values will be
 put at the end of the vector. Preserves indexing. Default sort algorithm is
 quick sort.

 == Options

 * +:ascending+ - if false, will sort in descending order. Defaults to true.

 * +:type+ - Specify the sorting algorithm. Only supports quick_sort for now.
 == Usage

   v = Daru::Vector.new ["My first guitar", "jazz", "guitar"]
   # Say you want to sort these strings by length.
   v.sort(ascending: false) { |a,b| a.length <=> b.length }