Skip to content

Commit 347b865

Browse files
committed
Avoid float16
1 parent f7ef882 commit 347b865

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

doc/source/user_guide/basics.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -2063,14 +2063,13 @@ or a passed ``Series``), then it will be preserved in DataFrame operations. Furt
20632063
different numeric dtypes will **NOT** be combined. The following example will give you a taste.
20642064

20652065
.. ipython:: python
2066-
:okwarning:
20672066
2068-
df1 = pd.DataFrame(np.random.randn(8, 1), columns=["A"], dtype="float32")
2067+
df1 = pd.DataFrame(np.random.randn(8, 1), columns=["A"], dtype="float64")
20692068
df1
20702069
df1.dtypes
20712070
df2 = pd.DataFrame(
20722071
{
2073-
"A": pd.Series(np.random.randn(8), dtype="float16"),
2072+
"A": pd.Series(np.random.randn(8), dtype="float32"),
20742073
"B": pd.Series(np.random.randn(8)),
20752074
"C": pd.Series(np.random.randint(0, 255, size=8), dtype="uint8"), # [0,255] (range of uint8)
20762075
}

doc/source/whatsnew/v0.11.0.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,11 @@ Dtypes
7373
Numeric dtypes will propagate and can coexist in DataFrames. If a dtype is passed (either directly via the ``dtype`` keyword, a passed ``ndarray``, or a passed ``Series``, then it will be preserved in DataFrame operations. Furthermore, different numeric dtypes will **NOT** be combined. The following example will give you a taste.
7474

7575
.. ipython:: python
76-
:okwarning:
7776
78-
df1 = pd.DataFrame(np.random.randn(8, 1), columns=['A'], dtype='float32')
77+
df1 = pd.DataFrame(np.random.randn(8, 1), columns=['A'], dtype='float64')
7978
df1
8079
df1.dtypes
81-
df2 = pd.DataFrame({'A': pd.Series(np.random.randn(8), dtype='float16'),
80+
df2 = pd.DataFrame({'A': pd.Series(np.random.randn(8), dtype='float32'),
8281
'B': pd.Series(np.random.randn(8)),
8382
'C': pd.Series(range(8), dtype='uint8')})
8483
df2

pandas/core/arrays/datetimelike.py

+4
Original file line numberDiff line numberDiff line change
@@ -2520,6 +2520,10 @@ def _validate_inferred_freq(
25202520
freq : DateOffset or None
25212521
"""
25222522
if inferred_freq is not None:
2523+
offset1 = to_offset(freq)
2524+
offset2 = to_offset(inferred_freq)
2525+
print(offset1, offset2)
2526+
print(type(offset1), type(offset2))
25232527
if freq is not None and freq != inferred_freq:
25242528
raise ValueError(
25252529
f"Inferred frequency {inferred_freq} from passed "

0 commit comments

Comments
 (0)