Skip to content

Commit

Permalink
Merge pull request #97 from jamesbaber1/main
Browse files Browse the repository at this point in the history
Fixed numpy value error on string
  • Loading branch information
louisnw01 authored Sep 3, 2023
2 parents aad2a98 + 06fb789 commit 2ff9d98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lightweight_charts/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _series_datetime_format(self, series: pd.Series, exclude_lowercase=None):
return series

def _single_datetime_format(self, arg):
if not pd.api.types.is_datetime64_any_dtype(arg):
if isinstance(arg, str) or not pd.api.types.is_datetime64_any_dtype(arg):
arg = pd.to_datetime(arg)
interval_seconds = self._interval.total_seconds()
arg = interval_seconds * (arg.timestamp() // interval_seconds)
Expand Down

0 comments on commit 2ff9d98

Please sign in to comment.