Closed
Description
import pandas as pd
import numpy as np
In [59]: df = pd.SparseDataFrame({"A": pd.SparseSeries(np.array([1, 1, 0], dtype='uint8'), fill_value=0), "B": pd.SparseSeries(np.array([1, 1, 0], dtype='uint8'), fill_value=0)})
In [60]: df.dtypes
Out[60]:
A uint8
B uint8
dtype: object
In [61]: df.A.fill_value
Out[61]: 0
In [62]: df.iloc[0:0].dtypes
Out[62]:
A float64
B float64
dtype: object
In [63]: df.iloc[0:0].A.fill_value
Out[63]: nan
non-empty slices are fine.