microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.3k stars 294 forks source link

dataviewer does not display timezone info for timezone-aware datetimeindex #16223

Closed xuancong84 closed 22 hours ago

xuancong84 commented 1 week ago

When a dataframe has tz-aware datetimeindex, dataviewer does not display timezone info correctly.

For example,

import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randn(10), index=pd.date_range('2024-10-01', '2024-10-10', tz='+08:00'))

print(df) gives:

                                  0
2024-10-01 00:00:00+08:00 -0.202646
2024-10-02 00:00:00+08:00 -0.655969
2024-10-03 00:00:00+08:00  0.193421
2024-10-04 00:00:00+08:00  0.553439
2024-10-05 00:00:00+08:00  1.318152
2024-10-06 00:00:00+08:00 -0.469305
2024-10-07 00:00:00+08:00  0.675554
2024-10-08 00:00:00+08:00 -1.817027
2024-10-09 00:00:00+08:00 -0.183109
2024-10-10 00:00:00+08:00  1.058969

But datetimeviewer gives: Image

The datetimeindex are all in UTC-0 instead of UTC+08.

amunger commented 1 week ago

What data viewer is that? I'm not seeing that with Data Wrangler: Image

vs-code-engineering[bot] commented 22 hours ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!