Open MarcoGorelli opened 3 days ago
For classical numpy dtypes in pandas, this should be more efficient than forcing slices + dicts
Spotted in Prophet
Desired syntax:
import narwhals as nw import numpy as np import pandas as pd arr = np.zeros([[1,2,3], [4,5,6]]) df = nw.from_2d_array(arr, column_names=['a', 'b', 'c'])
It should also be possible to pass in dtype as an argument - if not passed, it'll be autoinferred
dtype
import narwhals as nw import numpy as np import pandas as pd arr = np.zeros([[1,2,3], [4,5,6]]) df = nw.from_2d_array(arr, column_names=['a', 'b', 'c'], dtype=nw.Float64)
For classical numpy dtypes in pandas, this should be more efficient than forcing slices + dicts
Spotted in Prophet
Desired syntax:
It should also be possible to pass in
dtype
as an argument - if not passed, it'll be autoinferred