Skip to content

Commit ab622e3

Browse files
fix pandas warnings
1 parent 9a7adc7 commit ab622e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/python/plotly/plotly/data/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ def gapminder(datetimes=False, centroids=False, year=None):
1919
"""
2020
df = _get_dataset("gapminder")
2121
if year:
22-
df = df.query("year == %d" % year)
22+
df = df[df["year"] == year]
2323
if datetimes:
2424
df["year"] = (df["year"].astype(str) + "-01-01").astype("datetime64[ns]")
2525
if not centroids:
26-
df.drop(["centroid_lat", "centroid_lon"], axis=1, inplace=True)
26+
df = df.drop(["centroid_lat", "centroid_lon"], axis=1)
2727
return df
2828

2929

0 commit comments

Comments
 (0)