Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
source=source,
convert_date=convert_date,
cache=cache,
)
df = pd.DataFrame(
[[i["country"]["value"], i["date"], i["value"]] for i in raw_data],
columns=["country", "date", column_name],
)
df[column_name] = df[column_name].map(cast_float)
if not keep_levels and len(df["country"].unique()) == 1:
df = df.set_index("date")
elif not keep_levels and len(df["date"].unique()) == 1:
df = df.set_index("country")
else:
df = df.set_index(["country", "date"])
series = WBSeries(df[column_name])
series.last_updated = raw_data.last_updated
return series
def _constructor(self):
return WBSeries