Small fixes
This commit is contained in:
parent
54fbcb1ea6
commit
083f8a982e
24 changed files with 1505 additions and 79 deletions
|
|
@ -774,7 +774,7 @@ def test_epc_band_to_year_uses_midpoint_and_clamps():
|
|||
"b": [
|
||||
"England and Wales: 1950-1966", # midpoint 1958
|
||||
"1900-1929", # midpoint 1914
|
||||
"England and Wales: before 1900", # too wide -> null
|
||||
"England and Wales: before 1900", # open-ended -> 1900 - 10 = 1890
|
||||
"2012 onwards", # single year
|
||||
"1012", # implausible -> null
|
||||
"2202", # implausible -> null
|
||||
|
|
@ -784,4 +784,4 @@ def test_epc_band_to_year_uses_midpoint_and_clamps():
|
|||
}
|
||||
)
|
||||
years = df.select(epc_band_to_year(pl.col("b")).alias("y"))["y"].to_list()
|
||||
assert years == [1958, 1914, None, 2012, None, None, None, 1958]
|
||||
assert years == [1958, 1914, 1890, 2012, None, None, None, 1958]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue