Created
July 6, 2025 23:15
-
-
Save jmcph4/326e20d82f2605925a9f753d9daa56e1 to your computer and use it in GitHub Desktop.
slopper
This file contains hidden or 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
| import argparse | |
| import pandas as pd | |
| def main(): | |
| parser = argparse.ArgumentParser(description="Print earliest and latest timestamps in a CSV file.") | |
| parser.add_argument("csv_file", help="Path to the input CSV file") | |
| args = parser.parse_args() | |
| df = pd.read_csv(args.csv_file, parse_dates=["timestamp"]) | |
| min_ts = df["timestamp"].min() | |
| max_ts = df["timestamp"].max() | |
| print(f"Earliest timestamp: {min_ts}") | |
| print(f"Latest timestamp: {max_ts}") | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment