packages/vaex-core/vaex/__init__.py
def from_arrays(**arrays):
    """Create an in memory DataFrame from numpy arrays.

    Example

    >>> import vaex, numpy as np
    >>> x = np.arange(5)
    >>> y = x ** 2
    >>> vaex.from_arrays(x=x, y=y)
      #    x    y
      0    0    0
      1    1    1
      2    2    4
      3    3    9
      4    4   16
    >>> some_dict = {'x': x, 'y': y}
    >>> vaex.from_arrays(**some_dict)  # in case you have your columns in a dict
      #    x    y
      0    0    0
      1    1    1
      2    2    4
      3    3    9
      4    4   16

    :param arrays: keyword arguments with arrays
    :rtype: DataFrame
    """
    import numpy as np
    import six
    from .column import Column
    df = vaex.dataframe.DataFrameArrays("array")
    for name, array in arrays.items():
        if isinstance(array, Column):
            df.add_column(name, array)
        else:
            array = np.asanyarray(array)
            df.add_column(name, array)
    return df
def from_arrays(**arrays):
    import numpy as np
    import six
    from .column import Column
    df = vaex.dataframe.DataFrameArrays("array")
    for name, array in arrays.items():
        if isinstance(array, Column):
            df.add_column(name, array)
        else:
            array = np.asanyarray(array)
            df.add_column(name, array)
    return df
def from_arrays ( * * arrays ) : import numpy as np import six from . column import Column df = vaex . dataframe . DataFrameArrays ( "array" ) for name , array in arrays . items ( ) : if isinstance ( array , Column ) : df . add_column ( name , array ) else : array = np . asanyarray ( array ) df . add_column ( name , array ) return df
Create an in memory DataFrame from numpy arrays.

    Example

    >>> import vaex, numpy as np
    >>> x = np.arange(5)
    >>> y = x ** 2
    >>> vaex.from_arrays(x=x, y=y)
      #    x    y
      0    0    0
      1    1    1
      2    2    4
      3    3    9
      4    4   16
    >>> some_dict = {'x': x, 'y': y}
    >>> vaex.from_arrays(**some_dict)  # in case you have your columns in a dict
      #    x    y
      0    0    0
      1    1    1
      2    2    4
      3    3    9
      4    4   16

    :param arrays: keyword arguments with arrays
    :rtype: DataFrame
Create an in memory DataFrame from numpy arrays .