Skip to content

Commit 5ab8316

Browse files
committed
renamed the df_aslarray() function to df_asarray()
1 parent cd762d7 commit 5ab8316

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

larray/inout/csv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from larray.util.misc import skip_comment_cells, strip_rows, csv_open, deprecate_kwarg
1818
from larray.inout.session import register_file_handler
1919
from larray.inout.common import _get_index_col, FileHandler
20-
from larray.inout.pandas import df_aslarray, _axes_to_df, _df_to_axes, _groups_to_df, _df_to_groups
20+
from larray.inout.pandas import df_asarray, _axes_to_df, _df_to_axes, _groups_to_df, _df_to_groups
2121
from larray.example import get_example_filepath
2222

2323

@@ -230,7 +230,7 @@ def read_csv(filepath_or_buffer, nb_axes=None, index_col=None, sep=',', headerse
230230
df.index.names = combined_axes_names.split(headersep)
231231
raw = False
232232

233-
return df_aslarray(df, sort_rows=sort_rows, sort_columns=sort_columns, fill_value=fill_value, raw=raw, wide=wide)
233+
return df_asarray(df, sort_rows=sort_rows, sort_columns=sort_columns, fill_value=fill_value, raw=raw, wide=wide)
234234

235235

236236
def read_tsv(filepath_or_buffer, **kwargs):

larray/inout/excel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from larray.util.misc import deprecate_kwarg
2020
from larray.inout.session import register_file_handler
2121
from larray.inout.common import _get_index_col, FileHandler
22-
from larray.inout.pandas import df_aslarray, _axes_to_df, _df_to_axes, _groups_to_df, _df_to_groups
22+
from larray.inout.pandas import df_asarray, _axes_to_df, _df_to_axes, _groups_to_df, _df_to_groups
2323
from larray.inout.xw_excel import open_excel
2424
from larray.example import get_example_filepath
2525

@@ -220,8 +220,8 @@ def read_excel(filepath, sheet=0, nb_axes=None, index_col=None, fill_value=nan,
220220
else:
221221
# TODO: add support for range argument (using usecols, skiprows and nrows arguments of pandas.read_excel)
222222
df = pd.read_excel(filepath, sheet, index_col=index_col, engine=engine, **kwargs)
223-
return df_aslarray(df, sort_rows=sort_rows, sort_columns=sort_columns, raw=index_col is None,
224-
fill_value=fill_value, wide=wide)
223+
return df_asarray(df, sort_rows=sort_rows, sort_columns=sort_columns, raw=index_col is None,
224+
fill_value=fill_value, wide=wide)
225225

226226

227227
@register_file_handler('pandas_excel', ['xls', 'xlsx'] if xw is None else None)
@@ -282,7 +282,7 @@ def list_items(self):
282282
def _read_item(self, key, type, *args, **kwargs):
283283
if type == 'Array':
284284
df = self.handle.parse(key, *args, **kwargs)
285-
return df_aslarray(df, raw=True)
285+
return df_asarray(df, raw=True)
286286
elif type == 'Axis':
287287
return self.axes[key]
288288
elif type == 'Group':

larray/inout/hdf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from larray.util.misc import LHDFStore
1414
from larray.inout.session import register_file_handler
1515
from larray.inout.common import FileHandler
16-
from larray.inout.pandas import df_aslarray
16+
from larray.inout.pandas import df_asarray
1717
from larray.example import get_example_filepath
1818

1919

@@ -79,8 +79,8 @@ def read_hdf(filepath_or_buffer, key, fill_value=nan, na=nan, sort_rows=False, s
7979
if _type in ['Array', 'LArray']:
8080
# cartesian product is not necessary if the array was written by LArray
8181
cartesian_prod = writer != 'LArray'
82-
res = df_aslarray(pd_obj, sort_rows=sort_rows, sort_columns=sort_columns, fill_value=fill_value,
83-
parse_header=False, cartesian_prod=cartesian_prod)
82+
res = df_asarray(pd_obj, sort_rows=sort_rows, sort_columns=sort_columns, fill_value=fill_value,
83+
parse_header=False, cartesian_prod=cartesian_prod)
8484
if _meta is not None:
8585
res.meta = _meta
8686
elif _type == 'Axis':

larray/inout/misc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from larray.core.constants import nan
77
from larray.util.misc import StringIO, deprecate_kwarg
88
from larray.inout.common import _get_index_col
9-
from larray.inout.pandas import df_aslarray
9+
from larray.inout.pandas import df_asarray
1010
from larray.inout.csv import read_csv
1111

1212

@@ -114,8 +114,8 @@ def from_lists(data, nb_axes=None, index_col=None, fill_value=nan, sort_rows=Fal
114114
if index_col is not None:
115115
df.set_index([df.columns[c] for c in index_col], inplace=True)
116116

117-
return df_aslarray(df, raw=index_col is None, parse_header=False, sort_rows=sort_rows, sort_columns=sort_columns,
118-
fill_value=fill_value, wide=wide)
117+
return df_asarray(df, raw=index_col is None, parse_header=False, sort_rows=sort_rows, sort_columns=sort_columns,
118+
fill_value=fill_value, wide=wide)
119119

120120

121121
@deprecate_kwarg('nb_index', 'nb_axes', arg_converter=lambda x: x + 1)

larray/inout/pandas.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ def from_frame(df, sort_rows=False, sort_columns=False, parse_header=False, unfo
252252
return Array(data, axes, meta=meta)
253253

254254

255-
def df_aslarray(df, sort_rows=False, sort_columns=False, raw=False, parse_header=True, wide=True, cartesian_prod=True,
256-
**kwargs):
255+
def df_asarray(df, sort_rows=False, sort_columns=False, raw=False, parse_header=True, wide=True, cartesian_prod=True,
256+
**kwargs):
257257
r"""
258258
Prepare Pandas DataFrame and then convert it into Array.
259259
@@ -289,7 +289,7 @@ def df_aslarray(df, sort_rows=False, sort_columns=False, raw=False, parse_header
289289
-------
290290
Array
291291
"""
292-
# we could inline df_aslarray into the functions that use it, so that the original (non-cartesian) df is freed from
292+
# we could inline df_asarray into the functions that use it, so that the original (non-cartesian) df is freed from
293293
# memory at this point, but it would be much uglier and would not lower the peak memory usage which happens during
294294
# cartesian_product_df.reindex
295295

larray/inout/sas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pandas as pd
77

88
from larray.core.constants import nan
9-
from larray.inout.pandas import df_aslarray
9+
from larray.inout.pandas import df_asarray
1010
from larray.util.misc import deprecate_kwarg
1111

1212

@@ -32,4 +32,4 @@ def read_sas(filepath, nb_axes=None, index_col=None, fill_value=nan, na=nan, sor
3232
index_col = [index_col]
3333

3434
df = pd.read_sas(filepath, index=index_col, **kwargs)
35-
return df_aslarray(df, sort_rows=sort_rows, sort_columns=sort_columns, fill_value=fill_value)
35+
return df_asarray(df, sort_rows=sort_rows, sort_columns=sort_columns, fill_value=fill_value)

larray/inout/xw_excel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from larray.core.axis import Axis
1515
from larray.core.constants import nan
1616
from larray.core.group import _translate_sheet_name
17-
from larray.inout.pandas import df_aslarray
17+
from larray.inout.pandas import df_asarray
1818
from larray.inout.misc import from_lists
1919
from larray.util.misc import PY2, deprecate_kwarg
2020

@@ -56,7 +56,7 @@ class ArrayConverter(PandasDataFrameConverter):
5656
@classmethod
5757
def read_value(cls, value, options):
5858
df = PandasDataFrameConverter.read_value(value, options)
59-
return df_aslarray(df)
59+
return df_asarray(df)
6060

6161
@classmethod
6262
def write_value(cls, value, options):

0 commit comments

Comments
 (0)