-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add advanced example, development, and contributing docs
- Loading branch information
1 parent
3348842
commit 8d29ea7
Showing
3 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import pandas as pd | ||
|
||
from tz_canary import TransitionsData, infer_time_zone | ||
|
||
# We create a TransitionsData object to avoid having to recompute the transitions for | ||
# every call to validate_time_zone. | ||
transition_data = TransitionsData(2010, 2023) | ||
|
||
for i in range(10): | ||
df = pd.read_csv( | ||
"docs/data/example_data.csv", # In reality, these would be different files | ||
index_col="datetime", | ||
parse_dates=True, | ||
) | ||
plausible_time_zones = infer_time_zone(df.index, transition_data=transition_data) | ||
print(i, plausible_time_zones) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters