diff --git a/aio.html b/aio.html index e9ac0208..b6abcb92 100644 --- a/aio.html +++ b/aio.html @@ -1182,7 +1182,7 @@
swap = x # x = 1.0 y = 3.0 swap = 1.0
x = y # x = 3.0 y = 3.0 swap = 1.0
@@ -1262,7 +1262,7 @@ PYTHON<
-
+
PYTHON
@@ -1299,7 +1299,7 @@ Can you slice integers?
-
+
Numbers are not stored in the written representation, so they can’t
be treated like strings.
@@ -1357,7 +1357,7 @@ OUTPUT<
-
+
- It will slice the string, starting at the
low
index and
@@ -1389,7 +1389,7 @@ Fractions
-
+
It is a floating-point number (often abbreviated “float”).
@@ -1422,7 +1422,7 @@ Automatic Type Conversion
-
+
It is a float: integers are automatically converted to floats as
necessary.
@@ -1679,7 +1679,7 @@ Lists: Length and Indexing
-
+
PYTHON
@@ -1712,7 +1712,7 @@ List slicing
-
+
PYTHON
@@ -1780,7 +1780,7 @@ OUTPUT<
-
+
PYTHON
@@ -1831,7 +1831,7 @@ PYTHON<
-
+
OUTPUT
@@ -2959,7 +2959,7 @@ PYTHON<
-
+
PYTHON
@@ -3017,7 +3017,7 @@ PYTHON<
-
+
The datetime
module seems like it could help you.
@@ -3048,7 +3048,7 @@ PYTHON<
-
+
According to Washington
County Cooperative Library Services: “1971, August 26 – Ohio
@@ -3370,7 +3370,7 @@
Loop through a list
-
+
PYTHON
@@ -3426,7 +3426,7 @@ Use range() in a loop
-
+
PYTHON
@@ -3471,7 +3471,7 @@ Use a string index in a loop
-
+
PYTHON
@@ -3521,7 +3521,7 @@ Subtract a list of values in a loop
-
+
PYTHON
@@ -3571,7 +3571,7 @@ Key Points
Content from Looping Over Data Sets
-Last updated on 2024-06-17 |
+
Last updated on 2024-10-29 |
Edit this page
@@ -3619,9 +3619,10 @@ Objectives
PYTHON
-for filename in ['data/2011_circ.csv', 'data/2012_circ.csv']:
- data = pd.read_csv(filename)
- print(filename, data['ytd'].max())
+import pandas as pd
+for filename in ['data/2011_circ.csv', 'data/2012_circ.csv']:
+ data = pd.read_csv(filename)
+ print(filename, data['ytd'].max())
OUTPUT
@@ -3872,7 +3873,7 @@ Determining Matches
-
+
Only item 1 is matched by the wildcard expression
data/*circ.csv
.
@@ -3906,7 +3907,7 @@ PYTHON<
-
+
PYTHON
@@ -3946,7 +3947,7 @@ Compile CSVs into one DataFrame
-
+
PYTHON
@@ -5820,7 +5821,7 @@ Create a function
-
+
PYTHON
@@ -5866,7 +5867,7 @@ Conditional statements within functions
-
+
PYTHON
@@ -5933,7 +5934,7 @@ OUTPUT<
-
+
Global variables:
@@ -5975,7 +5976,7 @@ CSVs to Pandas function
-
+
PYTHON
diff --git a/for-loops.html b/for-loops.html
index a97a3592..af59c936 100644
--- a/for-loops.html
+++ b/for-loops.html
@@ -667,7 +667,7 @@ Loop through a list
-
+
PYTHON
@@ -723,7 +723,7 @@ Use range() in a loop
-
+
PYTHON
@@ -768,7 +768,7 @@ Use a string index in a loop
-
+
PYTHON
@@ -816,7 +816,7 @@ Subtract a list of values in a loop
-
+
PYTHON
diff --git a/index.html b/index.html
index d668d530..0d1e2c86 100644
--- a/index.html
+++ b/index.html
@@ -474,7 +474,7 @@