coverage_report¶
coverage_report
¶
coverage_report(panel: DataFrame, *, expected_freq: str = '5min', level: str = 'station') -> DataFrame
Longitudinal coverage: quantify missingness before you model.
Operators go offline and scrapers crash; calculate_net_flow / clustering silently
assume continuity. With level="station" this reports how complete each station's
series is, against the system-wide observation window (so a station that dropped out
shows low uptime). With level="system" it returns one row per system, the summary a
paper's "Data and methods" section needs: window, cadence, cadence jitter and overall
yield.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
panel
|
DataFrame
|
A panel from |
required |
expected_freq
|
str
|
Your intended polling cadence (a pandas offset alias). |
"5min"
|
level
|
('station', 'system')
|
|
"station"
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
For |
See Also
audit_feed : The audit behind the report.
generate_manifest : Manifest of an archived collection.
Examples:
>>> import pandas as pd
>>> panel = pd.DataFrame({
... "system_id": "s", "station_id": ["a", "a", "b"],
... "fetched_at": pd.to_datetime(
... ["2026-01-01T00:00Z", "2026-01-01T00:05Z", "2026-01-01T00:00Z"]),
... })
>>> int(coverage_report(panel, level="system")["total_snapshots"].iloc[0])
2
Source code in src/gbfs_toolkit/io/timeseries.py
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 | |