Skip to content

Commit b8050ea

Browse files
committed
Auto-format
1 parent d46b1a3 commit b8050ea

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

docs/tutorials/pandas_accessor_tutorial.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ def create_df(
131131

132132
n_ts = n_scenarios * n_variables * n_runs
133133
df = pd.DataFrame(
134-
50.0 * np.linspace(0.3, 1, n_ts)[:, np.newaxis] * np.linspace(0, 1, timepoints.size)[np.newaxis, :] + np.random.random((n_ts, timepoints.size)),
134+
50.0
135+
* np.linspace(0.3, 1, n_ts)[:, np.newaxis]
136+
* np.linspace(0, 1, timepoints.size)[np.newaxis, :]
137+
+ np.random.random((n_ts, timepoints.size)),
135138
columns=timepoints,
136139
index=idx,
137140
)
@@ -185,12 +188,16 @@ def create_df(
185188
# this can be quite powerful for quick plots.
186189

187190
# %%
188-
ax = small_ts.loc[pix.isin(variable="variable_0")].ct.plot(continuous_plot_kwargs=dict(alpha=0.3))
191+
ax = small_ts.loc[pix.isin(variable="variable_0")].ct.plot(
192+
continuous_plot_kwargs=dict(alpha=0.3)
193+
)
189194
ax.legend(ncols=3, loc="upper center", bbox_to_anchor=(0.5, -0.15))
190195

191196
# %%
192197
# TODO: move this to plotting section
193-
ax = small_ts.loc[pix.isin(variable="variable_0", run=0)].ct.plot(label="scenario", continuous_plot_kwargs=dict(alpha=0.9))
198+
ax = small_ts.loc[pix.isin(variable="variable_0", run=0)].ct.plot(
199+
label="scenario", continuous_plot_kwargs=dict(alpha=0.9)
200+
)
194201
ax.legend()
195202

196203
# %% [markdown]
@@ -272,8 +279,7 @@ def create_df(
272279

273280
# %%
274281
ax = (
275-
bigger_df
276-
.loc[pix.isin(variable="variable_1")]
282+
bigger_df.loc[pix.isin(variable="variable_1")]
277283
.groupby(["scenario", "variable", "units"], observed=True)
278284
.median()
279285
.loc[pix.ismatch(scenario="scenario_1*")]
@@ -297,7 +303,9 @@ def create_df(
297303
small_ts.ct.to_df(increase_resolution=3)
298304

299305
# %%
300-
sns_df = small_ts.loc[pix.isin(scenario=[f"scenario_{i}" for i in range(2)])].ct.to_sns_df(increase_resolution=100)
306+
sns_df = small_ts.loc[
307+
pix.isin(scenario=[f"scenario_{i}" for i in range(2)])
308+
].ct.to_sns_df(increase_resolution=100)
301309
sns_df
302310

303311
# %%

0 commit comments

Comments
 (0)