constructor(data: Array<Object> | Object, kwargs: Object = {}) {
    super(data, kwargs);

    if (Array.isArray(data)) {
      this.set_axis(0, parseIndex(kwargs.index, Immutable.List(data)));
      this._data = parseArrayToSeriesMap(data, this.index);
      this.set_axis(1, this._data.keySeq());
    } else if (data instanceof Immutable.Map) {
      this._data = Immutable.OrderedMap(data.keySeq().map((k) => {
        if (data instanceof Immutable.Map && !(data.get(k) instanceof Series))
          throw new Error('Map must have [column, series] key-value pairs');

        if (data instanceof Immutable.Map)
          return [k, data.get(k).copy()];

        throw new Error('Data is not Map');
      }));
      this.set_axis(1, this._data.keySeq());
      this.set_axis(0, this._data.get(this.columns.get(0)).index);
    } else if (data instanceof Immutable.List) { // List of List of row values
      let columns;
      if (Array.isArray(kwargs.columns) || kwargs.columns instanceof Immutable.Seq)
        columns = Immutable.List(kwargs.columns);
      else if (kwargs.columns instanceof Immutable.List)
        columns = kwargs.columns;
      else if (typeof kwargs.columns === 'undefined')
        columns = Immutable.Range(0, data.get(0).size).toList();
      else
        throw new Error('Invalid columns');

      this._values = data; // Cache the values since we're in List of List or row data already
      this._data = Immutable.OrderedMap(columns.map((c, colIdx) =>
        ([c, new Series(data.map(row => row.get(colIdx)), {index: kwargs.index})])));

      this.set_axis(1, this._data.keySeq());
      this.set_axis(0, this._data.get(this.columns.get(0)).index);
    } else if (typeof data === 'undefined') {
      this._data = Immutable.Map({});
      this.set_axis(0, Immutable.List.of());
      this.set_axis(1, Immutable.Seq.of());
    }

    this._setup_axes(Immutable.List.of(0, 1));
  }
Two-dimensional size-mutable, potentially heterogeneous tabular data
structure with labeled axes (rows and columns). Arithmetic operations
align on both row and column labels. Can be thought of as a Immutable.Map-like
container for Series objects. The primary pandas data structure

@param data {Array|Object}
   Data to be stored in DataFrame
@param {Object} kwargs
   Extra optional arguments for a DataFrame
@param {Array|Object} [kwargs.index]

@example
const df = new DataFrame([{x: 1, y: 2}, {x: 2, y: 3}, {x: 3, y: 4}])

// Returns:
//    x  |  y
// 0  1  |  2
// 1  2  |  3
// 2  3  |  4
df.toString();