diff --git a/src/pykx/pandas_api/pandas_meta.py b/src/pykx/pandas_api/pandas_meta.py index 39668d5..91cc147 100644 --- a/src/pykx/pandas_api/pandas_meta.py +++ b/src/pykx/pandas_api/pandas_meta.py @@ -50,9 +50,9 @@ def _get_bool_only_subtable(tab): def preparse_computations(tab, axis=0, skipna=True, numeric_only=False, bool_only=False): - cols = q('cols', tab) if 'Keyed' in str(type(tab)): - tab = q('{(keys x) _ 0!x}', tab) + tab = tab.values() + cols = tab.columns if numeric_only: (tab, cols) = _get_numeric_only_subtable_with_bools(tab) if bool_only: diff --git a/tests/test_pandas_api.py b/tests/test_pandas_api.py index acfe55f..d1247ea 100644 --- a/tests/test_pandas_api.py +++ b/tests/test_pandas_api.py @@ -1810,6 +1810,15 @@ def test_pandas_max(q): for i in range(100): assert float(qmax[i]) == float(pmax[i]) + ktab = tab.set_index('sym') + df = ktab.pd() + + qmax = ktab.max().py() + pmax = df.max() + + assert float(pmax['price']) == qmax['price'] + assert float(pmax['ints']) == qmax['ints'] + def test_pandas_all(q): tab = q(