astype(nextType: DType): Series {
    if (!(nextType instanceof DType))
      throw new Error('Next type must be a DType');

    if (nextType.dtype === this.dtype)
      return this;

    switch (nextType.dtype) {
      case 'int': {
        if (this.dtype.dtype === 'object') throw new Error('Cannot convert object to int');
        const kwargs = {name: this.name, index: this.index};
        return new Series(this.values.map(v => Math.floor(v)), kwargs);
      }
      case 'float': {
        if (this.dtype.dtype === 'object') throw new Error('Cannot convert object to float');
        const kwargs = {name: this.name, index: this.index};
        return new Series(this.values.map(v => parseFloat(v)), kwargs);
      }
      default:
        throw new Error(`Invalid dtype ${nextType}`);
    }
  }
Convert the series to the desired type

pandas equivalent: [Series.astype](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.astype.html)

@param {DType} nextType

@example
const ds = new Series([1.5, 2, 3], {name: 'Series name'});

// dtype('float')
ds.dtype;

// Series([1, 2, 3])
ds.astype(new DType('int'))