diff --git a/README.md b/README.md index bab10e5..fce8fde 100644 --- a/README.md +++ b/README.md @@ -3143,7 +3143,7 @@ y 2 | sr.trans(…) | y 2 | y 2 | y 2 | +-------------+-------------+-------------+---------------+ ``` -* **Last result has a hierarchical index. `'[, ]'` returns the value.** +* **Last result has a hierarchical index. Use `'[, ]'` to get the value.** ### DataFrame **Table with labeled rows and columns.** @@ -3387,12 +3387,12 @@ def scrape_data(): covid = pd.read_csv('https://covid.ourworldindata.org/data/owid-covid-data.csv', usecols=['date', 'total_cases']) covid = covid.groupby('date').sum() - dow, gold, bitcoin = [scrape_yahoo(id_) for id_ in ('^DJI', 'GC=F', 'BTC-USD')] - dow.name, gold.name, bitcoin.name = 'Dow Jones', 'Gold', 'Bitcoin' - return covid, dow, gold, bitcoin + dow, gold, btc = [scrape_yahoo(id_) for id_ in ('^DJI', 'GC=F', 'BTC-USD')] + dow.name, gold.name, btc.name = 'Dow Jones', 'Gold', 'Bitcoin' + return covid, dow, gold, btc -def wrangle_data(covid, dow, gold, bitcoin): - df = pandas.concat([covid, dow, gold, bitcoin], axis=1) +def wrangle_data(covid, dow, gold, btc): + df = pandas.concat([covid, dow, gold, btc], axis=1) df = df.loc['2020-02-23':].iloc[:-2] df = df.interpolate() df.iloc[:, 1:] = df.rolling(10, min_periods=1, center=True).mean().iloc[:, 1:] diff --git a/index.html b/index.html index 5342577..5f081d8 100644 --- a/index.html +++ b/index.html @@ -2681,7 +2681,7 @@ y 2 ┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
    -
  • Last result has a hierarchical index. '<Sr>[<key_1>, <key_2>]' returns the value.
  • +
  • Last result has a hierarchical index. Use '<Sr>[<key_1>, <key_2>]' to get the value.

DataFrame

Table with labeled rows and columns.

>>> DataFrame([[1, 2], [3, 4]], index=['a', 'b'], columns=['x', 'y'])
    x  y
@@ -2871,12 +2871,12 @@ plotly.express.line(df, x='Date', y='https://covid.ourworldindata.org/data/owid-covid-data.csv', 
                         usecols=['date', 'total_cases'])
     covid = covid.groupby('date').sum()
-    dow, gold, bitcoin = [scrape_yahoo(id_) for id_ in ('^DJI', 'GC=F', 'BTC-USD')]
-    dow.name, gold.name, bitcoin.name = 'Dow Jones', 'Gold', 'Bitcoin'
-    return covid, dow, gold, bitcoin
+    dow, gold, btc = [scrape_yahoo(id_) for id_ in ('^DJI', 'GC=F', 'BTC-USD')]
+    dow.name, gold.name, btc.name = 'Dow Jones', 'Gold', 'Bitcoin'
+    return covid, dow, gold, btc
 
-def wrangle_data(covid, dow, gold, bitcoin):
-    df = pandas.concat([covid, dow, gold, bitcoin], axis=1)
+def wrangle_data(covid, dow, gold, btc):
+    df = pandas.concat([covid, dow, gold, btc], axis=1)
     df = df.loc['2020-02-23':].iloc[:-2]
     df = df.interpolate()
     df.iloc[:, 1:] = df.rolling(10, min_periods=1, center=True).mean().iloc[:, 1:]
diff --git a/pdf/index_for_pdf.html b/pdf/index_for_pdf.html
index 0d03f6b..d5b87c9 100644
--- a/pdf/index_for_pdf.html
+++ b/pdf/index_for_pdf.html
@@ -121,7 +121,7 @@
 regular expressions, 5-6
requests library, 35, 36

S

-

scraping, 35, 43, 47, 48
+

scraping, 35, 43, 46, 47, 48
sequence, 4, 18, 19
sets, 2, 11
shell commands, 25
diff --git a/pdf/index_for_pdf_print.html b/pdf/index_for_pdf_print.html index b4169b3..f6d485c 100644 --- a/pdf/index_for_pdf_print.html +++ b/pdf/index_for_pdf_print.html @@ -121,7 +121,7 @@ regular expressions, 5-6
requests library, 35, 36

S

-

scraping, 35, 43, 47, 48
+

scraping, 35, 43, 46, 47, 48
sequence, 4, 18, 19
sets, 2, 11
shell commands, 25