This commit is contained in:
David Brazda
2024-10-02 13:41:14 +02:00
parent 2b9f238a42
commit 35f029714b
2 changed files with 3 additions and 3 deletions

View File

@ -202,7 +202,7 @@ class SeriesCommon(Pane):
self._set_interval(df) self._set_interval(df)
if not pd.api.types.is_datetime64_any_dtype(df['time']): if not pd.api.types.is_datetime64_any_dtype(df['time']):
df['time'] = pd.to_datetime(df['time']) df['time'] = pd.to_datetime(df['time'])
df['time'] = (df['time'].astype('int64') / 10 ** 6).astype(float) df['time'] = (df['time'].astype('int64') / 10 ** 9).astype(float)
# if 'updated' in df.columns: # if 'updated' in df.columns:
# df['updated'] = pd.to_datetime(df['updated']).astype('int64') / 10**9 # df['updated'] = pd.to_datetime(df['updated']).astype('int64') / 10**9
@ -213,7 +213,7 @@ class SeriesCommon(Pane):
if col == 'time' or not pd.api.types.is_datetime64_any_dtype(df[col]): if col == 'time' or not pd.api.types.is_datetime64_any_dtype(df[col]):
continue continue
# Convert datetime to timestamp with nanosecond precision after the decimal # Convert datetime to timestamp with nanosecond precision after the decimal
df[col] = (pd.to_datetime(df[col]).astype('int64') / 10**6).astype(float) df[col] = (pd.to_datetime(df[col]).astype('int64') / 10**9).astype(float)
return df return df

View File

@ -5,7 +5,7 @@ with open('README.md', 'r', encoding='utf-8') as f:
setup( setup(
name='lightweight_charts', name='lightweight_charts',
version='2.1.5', version='2.1.6',
packages=find_packages(), packages=find_packages(),
python_requires='>=3.8', python_requires='>=3.8',
install_requires=[ install_requires=[