A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/41544 below:

Empty DataFrame(..., dtype='datetime64[ns]').quantile(..., axis=1) returns float64 dtype · Issue #41544 · pandas-dev/pandas · GitHub

This ideally should still return datetime64[ns] dtype

In [1]: df = DataFrame(columns=["a", "b"], dtype="datetime64[ns]")

In [2]: df
Out[2]:
Empty DataFrame
Columns: [a, b]
Index: []

In [3]: df.quantile(0.5, axis=1, numeric_only=False)
Out[3]: Series([], Name: 0.5, dtype: float64)

In [4]: df.quantile(0.5, axis=1, numeric_only=False).dtype
Out[4]: dtype('float64')

In [5]: df
Out[5]:
Empty DataFrame
Columns: [a, b]
Index: []

In [6]: df.T
Out[6]:
Empty DataFrame
Columns: []
Index: [a, b]

# Probably the reason why we might get float64 dtype afterwards
In [7]: df.T.dtypes
Out[7]: Series([], dtype: object)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4