misikoff commited on
Commit
f372b60
·
1 Parent(s): 2026bf1

feat: add days on market to configs

Browse files
Files changed (1) hide show
  1. zillow.py +56 -0
zillow.py CHANGED
@@ -259,6 +259,36 @@ class NewDataset(datasets.GeneratorBasedBuilder):
259
  ),
260
  }
261
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  return datasets.DatasetInfo(
263
  # This is the description that will appear on the datasets page.
264
  description=_DESCRIPTION,
@@ -439,3 +469,29 @@ class NewDataset(datasets.GeneratorBasedBuilder):
439
  "ZHVI": data["ZHVI"],
440
  "Mid Tier ZHVI": data["Mid Tier ZHVI"],
441
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  ),
260
  }
261
  )
262
+ elif self.config.name == "days_on_market":
263
+ features = datasets.Features(
264
+ {
265
+ "Region ID": datasets.Value(dtype="string", id="Region ID"),
266
+ "Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
267
+ "Region": datasets.Value(dtype="string", id="Region"),
268
+ "Region Type": datasets.Value(dtype="string", id="Region Type"),
269
+ "State": datasets.Value(dtype="string", id="State"),
270
+ "Home Type": datasets.Value(dtype="string", id="Home Type"),
271
+ "Date": datasets.Value(dtype="string", id="Date"),
272
+ "Mean Listings Price Cut Amount (Smoothed)": datasets.Value(
273
+ dtype="float32", id="Mean Listings Price Cut Amount (Smoothed)"
274
+ ),
275
+ "Percent Listings Price Cut": datasets.Value(
276
+ dtype="float32", id="Percent Listings Price Cut"
277
+ ),
278
+ "Mean Listings Price Cut Amount": datasets.Value(
279
+ dtype="float32", id="Mean Listings Price Cut Amount"
280
+ ),
281
+ "Percent Listings Price Cut (Smoothed)": datasets.Value(
282
+ dtype="float32", id="Percent Listings Price Cut (Smoothed)"
283
+ ),
284
+ "Median Days on Pending (Smoothed)": datasets.Value(
285
+ dtype="float32", id="Median Days on Pending (Smoothed)"
286
+ ),
287
+ "Median Days on Pending": datasets.Value(
288
+ dtype="float32", id="Median Days on Pending"
289
+ ),
290
+ }
291
+ )
292
  return datasets.DatasetInfo(
293
  # This is the description that will appear on the datasets page.
294
  description=_DESCRIPTION,
 
469
  "ZHVI": data["ZHVI"],
470
  "Mid Tier ZHVI": data["Mid Tier ZHVI"],
471
  }
472
+ elif self.config.name == "days_on_market":
473
+ yield key, {
474
+ "Region ID": data["Region ID"],
475
+ "Size Rank": data["Size Rank"],
476
+ "Region": data["Region"],
477
+ "Region Type": data["Region Type"],
478
+ "State": data["State"],
479
+ "Home Type": data["Home Type"],
480
+ "Date": data["Date"],
481
+ "Mean Listings Price Cut Amount (Smoothed)": data[
482
+ "Mean Listings Price Cut Amount (Smoothed)"
483
+ ],
484
+ "Percent Listings Price Cut": data[
485
+ "Percent Listings Price Cut"
486
+ ],
487
+ "Mean Listings Price Cut Amount": data[
488
+ "Mean Listings Price Cut Amount"
489
+ ],
490
+ "Percent Listings Price Cut (Smoothed)": data[
491
+ "Percent Listings Price Cut (Smoothed)"
492
+ ],
493
+ "Median Days on Pending (Smoothed)": data[
494
+ "Median Days on Pending (Smoothed)"
495
+ ],
496
+ "Median Days on Pending": data["Median Days on Pending"],
497
+ }