Skip to content

Commit 220ee2d

Browse files
committed
Adding pandas Int64 support [fix astropy#9280]
1 parent a1c6529 commit 220ee2d

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎astropy/table/table.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3218,7 +3218,7 @@ def to_pandas(self, index=None):
32183218
2002-01-01 2.0 6.0 8.0 00:03:20
32193219
32203220
"""
3221-
from pandas import DataFrame
3221+
from pandas import DataFrame, Series
32223222

32233223
if index is not False:
32243224
if index in (None, True):
@@ -3283,10 +3283,7 @@ def _encode_mixins(tbl):
32833283
for name, column in tbl.columns.items():
32843284
if isinstance(column, MaskedColumn) and np.any(column.mask):
32853285
if column.dtype.kind in ['i', 'u']:
3286-
out[name] = column.astype(float).filled(np.nan)
3287-
warnings.warn(
3288-
"converted column '{}' from integer to float".format(
3289-
name), TableReplaceWarning, stacklevel=3)
3286+
out[name] = Series(column, dtype='Int64')
32903287
elif column.dtype.kind in ['f', 'c']:
32913288
out[name] = column.filled(np.nan)
32923289
else:

0 commit comments

Comments
 (0)