Skip to content

Instantly share code, notes, and snippets.

@jmcph4
Created July 6, 2025 23:15
Show Gist options
  • Select an option

  • Save jmcph4/326e20d82f2605925a9f753d9daa56e1 to your computer and use it in GitHub Desktop.

Select an option

Save jmcph4/326e20d82f2605925a9f753d9daa56e1 to your computer and use it in GitHub Desktop.
slopper
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