Skip to content

Commit 9a7adc7

Browse files
fix silly bug
1 parent 612d3f9 commit 9a7adc7

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
@@ -18,12 +18,12 @@ def gapminder(datetimes=False, centroids=False, year=None):
1818
If `year` is an integer, the dataset will be filtered for that year
1919
"""
2020
df = _get_dataset("gapminder")
21+
if year:
22+
df = df.query("year == %d" % year)
2123
if datetimes:
2224
df["year"] = (df["year"].astype(str) + "-01-01").astype("datetime64[ns]")
2325
if not centroids:
2426
df.drop(["centroid_lat", "centroid_lon"], axis=1, inplace=True)
25-
if year:
26-
df = df.query("year == %d" % year)
2727
return df
2828

2929

0 commit comments

Comments
 (0)