Skip to content

Commit 3c69f38

Browse files
fixed a few broken tests
1 parent 68dbccb commit 3c69f38

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pandas/core/apply.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ def apply_series_generator(self) -> Tuple[ResType, "Index"]:
343343
def wrap_results(
344344
self, results: ResType, res_index: "Index"
345345
) -> Union["Series", "DataFrame"]:
346+
from pandas import Series
346347

347348
# see if we can infer the results
348349
if len(results) > 0 and 0 in results and is_sequence(results[0]):
@@ -354,7 +355,7 @@ def wrap_results(
354355
constructor_sliced = self.obj._constructor_sliced
355356
is_empty = isinstance(results, (list, tuple, dict)) and not results
356357
if constructor_sliced is Series and is_empty:
357-
result = constructor_sliced(results, dtype=object)
358+
result = constructor_sliced(results, dtype=np.float64)
358359
else:
359360
result = constructor_sliced(results)
360361
result.index = res_index

pandas/tests/frame/test_analytics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ def test_mean_mixed_datetime_numeric(self, tz):
10671067
tm.assert_series_equal(result, expected)
10681068

10691069
@pytest.mark.parametrize("tz", [None, "UTC"])
1070-
def test_mean_excludeds_datetimes(self, tz):
1070+
def test_mean_excludes_datetimes(self, tz):
10711071
# https://github.com/pandas-dev/pandas/issues/24752
10721072
# Our long-term desired behavior is unclear, but the behavior in
10731073
# 0.24.0rc1 was buggy.

0 commit comments

Comments
 (0)