MCPcopy Create free account
hub / github.com/spotify/chartify / _plot_shaded_interval

Function _plot_shaded_interval

chartify/examples.py:345–363  ·  view source on GitHub ↗

Shaded interval example

(data)

Source from the content-addressed store, hash-verified

343
344@_print_source
345def _plot_shaded_interval(data):
346 """
347 Shaded interval example
348 """
349
350 # Sum price grouped by date
351 price_by_date = (
352 data.groupby(["date"])["total_price"]
353 .agg(["mean", "std", "count"])
354 .loc["2017-12-01":]
355 .assign(
356 lower_ci=lambda x: x["mean"] - 1.96 * x["std"] / x["count"] ** 0.5,
357 upper_ci=lambda x: x["mean"] + 1.96 * x["std"] / x["count"] ** 0.5,
358 )
359 .reset_index()
360 )
361 print(price_by_date.head())
362 """Print break"""
363 _shaded_interval_example_1(price_by_date)
364
365
366@_print_source

Callers 1

plot_areaFunction · 0.85

Calls 1

Tested by

no test coverage detected