Skip to content

BUG:  #53534

@koopa31

Description

@koopa31

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

from skimage.io import imread
import pandas as pd

path = "path/to/image"
# Image is uint8
image = imread(path)

list = []

list.append(image.max())

df = pd.DataFrame(zip(*list))
df.to_excel(os.path.join(path, "quantification.xlsx"), index=False, engine="xlsxwriter")

Issue Description

Hi,
I faced a conversion problem trying to store images max in a pandas dataframe and writing it to xlsx file. Indeed, when I read image.max() value, it is a positive integer value equal to 129. When I write it in the excel table, it is equal to -127; which seems to be a conversion to int8 I did nit ask for.
Thank you
Clément

Expected Behavior

To correct that I force the value to be int(max), but is there an actual solution not to make this implicit conversion from uint8 to int8 ?

Installed Versions

version is 1.3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO Excelread_excel, to_excelNeeds InfoClarification about behavior needed to assess issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions