Skip to content

TypeError in adjustColumnWidths: numpy.float64 cannot be interpreted as integer #267

Description

@JeanAumont

When importing CSV data with numeric columns, adjustColumnWidths fails with:

TypeError: 'numpy.float64' object cannot be interpreted as an integer

Location: core.py, line 812
Code: txt = ''.join(['X' for i in range(l+1)])

Fix: txt = ''.join(['X' for i in range(int(l)+1)])

This occurs because pandas may return numpy.float64 values which cannot
be used directly in range().

Steps to reproduce: Your CSV export/import scenario
Python version: 3.12
Pandas version: 3.0.0

Thanks

Jean Aumont

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions