Skip to content

Commit 5717015

Browse files
committed
changes
1 parent 8b986d6 commit 5717015

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pandas/core/internals/construction.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,13 @@ def init_dict(data, index, columns, dtype=None):
195195
arrays.loc[missing] = [val] * missing.sum()
196196

197197
else:
198-
data = OrderedDict((col_name, com.maybe_itarable_to_list(col))
199-
for col_name, col in data.items())
200198
keys = com.dict_keys_to_ordered_list(data)
201199
columns = data_names = Index(keys)
200+
arrays = (com.maybe_itarable_to_list(data[k]) for k in keys)
202201
# GH#24096 need copy to be deep for datetime64tz case
203202
# TODO: See if we can avoid these copies
204-
arrays = [data[k] if not is_datetime64tz_dtype(data[k]) else
205-
data[k].copy(deep=True) for k in keys]
203+
arrays = [arr if not is_datetime64tz_dtype(arr) else
204+
arr.copy(deep=True) for arr in arrays]
206205
return arrays_to_mgr(arrays, data_names, index, columns, dtype=dtype)
207206

208207

0 commit comments

Comments
 (0)