-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataError with timedelta #536
Labels
Comments
maximlt
changed the title
DataError with timedelta when hvplot.pandas imported
DataError with timedelta
Nov 4, 2021
Thanks for this report, I edited the title since I'm able to reproduce it without hvplot being involved at all. import geopandas as gpd
import geoviews as gv
import pandas as pd
gv.extension('bokeh')
df = pd.DataFrame(
data={
"time": pd.date_range("2000", freq="D", periods=3),
"lon": [1, 2, 3],
"lat": [1, 2, 3],
}
)
df["timedelta"] = df["time"] - df["time"].min() # Uncomment this and works
gdf = gpd.GeoDataFrame(
df,
geometry=gpd.points_from_xy(df["lon"], df["lat"]),
crs="epsg:4326",
)
gv.Points(gdf) |
A simple workaround: gv.points(gdf, vdims=[]) |
Not sure if it's a bug because there's 4 dims Nevermind, I remembered holoviews behavior incorrectly This works import geopandas as gpd
import geoviews as gv
import pandas as pd
import holoviews as hv
gv.extension('bokeh')
df = pd.DataFrame(
data={
"time": pd.date_range("2000", freq="D", periods=3),
"lon": [1, 2, 3],
"lat": [1, 2, 3],
}
)
df["timedelta"] = df["time"] - df["time"].min()
hv.Points(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ALL software version info
ipython 7.27.0
hvplot 0.7.3
geoviews 1.9.2
jupyterlab 3.2.1
Description of expected behavior and the observed behavior
geopandas.DataFrame gets passed to
gv.Points
and is displayed correctComplete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
The text was updated successfully, but these errors were encountered: