642 northumbriaData1 = (
643 northumbria2020Dataset.groupby(["age_range", "gender"]).std().unstack()
644 )
645 fig, (ax0, ax1) = plt.subplots(646 nrows=2, ncols=1, sharey=True, figsize=(10, 10)
647 )
648 northumbriaData0.plot(kind="barh", y="day", ax=ax0)
591 .mean()
592 .unstack()
593 )
594 fig, (ax0, ax1) = plt.subplots(595 nrows=2, ncols=1, sharey=True, figsize=(30, 10)
596 )
597 northumbriaData0.plot(kind="hist", y="week", ax=ax0)
435 clevelandAgeRange = (
436 clevelandDataset.groupby(["outcome", "age_range"]).sum().unstack()
437 )
438 fig, (ax0, ax1) = plt.subplots(nrows=1, ncols=2, sharex=True, figsize=(10, 10))439 clevelandAgeRange.plot(kind="bar", y="months", ax=ax0)
440 northumbriaAgeRange.plot(kind="bar", y="months", ax=ax1)
441 ax0.set(title="Cleveland result", xlabel="outcome", ylabel="time")
355 totalStocktononTeesTable = stocktonOnTeesTable.sum(axis=1, numeric_only=True)
356 stocktonOnTeesTable["TotalRollingRate"] = totalStocktononTeesTable
357 # create 3 plots to display results
358 fig, (ax0, ax1, ax2) = plt.subplots(359 nrows=1, ncols=3, sharey=True, figsize=(10, 66)
360 )
361 darlingtonTable.plot(kind="hist", y="TotalRollingRate", x="Week", ax=ax0)
287 covidData = pd.read_csv(file7, index_col=0, parse_dates=["date"])
288
289 covidData.drop_duplicates()
290 valueNull = covidData.isnull().sum()291 cumulativeSumTable = covidData.drop(
292 [
293 "newCasesBySpecimenDate-0_4",
An unused variable takes up space in the code, and can lead to confusion, and it should be removed. If this variable is necessary, name the variable _
to indicate that it will be unused, or start the name with unused
or _unused
.
def update():
for i in range(10): # Usused variable `i`
time.sleep(0.01)
display_result()
def update():
for _ in range(10):
time.sleep(0.01)
display_result()