We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7724ff commit a7b4e27Copy full SHA for a7b4e27
pandas/core/internals/managers.py
@@ -445,11 +445,15 @@ def convert(self: T, copy: bool | None) -> T:
445
elif copy is None:
446
copy = True
447
448
+ if self.is_single_block:
449
+ original_blocks = [self.blocks[0]]
450
+ else:
451
+ original_blocks = [self.blocks[i] for i in self.blknos]
452
mgr = self.apply(
453
"convert",
454
copy=copy,
455
using_copy_on_write=using_copy_on_write(),
- original_blocks=[self.blocks[i] for i in self.blknos],
456
+ original_blocks=original_blocks,
457
)
458
refs = [getattr(blk, "_ref", None) is not None for blk in mgr.blocks]
459
if any(ref is not None for ref in refs):
0 commit comments