Skip to content

Various issues with timezone aware datetime objects (datetime, numpy, pandas) #195

Closed
@acommendador

Description

@acommendador

Replicate with the following code:

from xlwings import Workbook, Range
import pandas as pd
import numpy as np
dt = np.datetime64(1434149887000,'ms')
data_list = np.empty(1, dtype=np.float64)
data_list[:] = 1
dti = pd.DatetimeIndex(data=[dt],tz='GMT')
df = pd.DataFrame(data=data_list, index=dti, columns=['A'])
wb = Workbook()
Range('A1',wkb=wb).value = df

The code will work if line dti = pd.DatetimeIndex(data=[dt],tz='GMT') is changed to dti = pd.DatetimeIndex(data=[dt]).

We found that it hangs during the last line of the main.py Range value method: xlplatform.set_value(xlplatform.get_range_from_indices(self.xl_sheet, self.row1, self.col1, row2, col2), data).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions