Skip to content

Commit 30bd5ca

Browse files
committed
CLN: replace lambdas with defs
1 parent 80055fd commit 30bd5ca

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Diff for: pandas/core/sparse/frame.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,10 @@ def _init_dict(self, data, index, columns, dtype=None):
148148
if index is None:
149149
index = extract_index(list(data.values()))
150150

151-
sp_maker = lambda x: SparseArray(x, kind=self._default_kind,
152-
fill_value=self._default_fill_value,
153-
copy=True, dtype=dtype)
151+
def sp_maker(x):
152+
return SparseArray(x, kind=self._default_kind,
153+
fill_value=self._default_fill_value,
154+
copy=True, dtype=dtype)
154155
sdict = {}
155156
for k, v in compat.iteritems(data):
156157
if isinstance(v, Series):
@@ -397,9 +398,10 @@ def _sanitize_column(self, key, value, **kwargs):
397398
sanitized_column : SparseArray
398399
399400
"""
400-
sp_maker = lambda x, index=None: SparseArray(
401-
x, index=index, fill_value=self._default_fill_value,
402-
kind=self._default_kind)
401+
def sp_maker(x, index=None):
402+
return SparseArray(x, index=index,
403+
fill_value=self._default_fill_value,
404+
kind=self._default_kind)
403405
if isinstance(value, SparseSeries):
404406
clean = value.reindex(self.index).as_sparse_array(
405407
fill_value=self._default_fill_value, kind=self._default_kind)

0 commit comments

Comments
 (0)