Skip to main content

activity_log_raw: activity log

A large log of timestamped activity events, used to practise reading and processing a file that is too big to load into memory at once. Back to Course datasets

File

File data/raw/activity_log_raw.csv
Size on disk 8.3 GB
Format CSV with a header row; comma-delimited
Rows about 190 million (estimated from file size)
Used in Days 2–4

Columns

# Name Type Description
0 SID integer (1–3 digits) To be described
1 ACTIVITY_ID integer Identifier of the activity. To be described
2 ACTIVITY_TIME text (timestamp) Date and time of the activity, in the format DD-MON-YY HH.MI.SS.fffffffff AM/PM
3 STATUS text (one letter) Status of the activity, as a one-letter code. To be described

Notes

  • Don’t load the whole file with pandas. Read it in chunks (pd.read_csv(..., chunksize=...)) or with Spark.
  • Parse ACTIVITY_TIME with an explicit format: the month is a three-letter abbreviation, the time uses dots as separators, has nanoseconds and a 12-hour clock with AM/PM. In Spark: to_timestamp(col("ACTIVITY_TIME"), "dd-MMM-yy hh.mm.ss.SSSSSSSSS a").
  • STATUS is case-sensitive: the sample has 8 distinct codes, one of them lowercase. Don’t change the case before counting.
  • Spark infers ACTIVITY_TIME as text; give an explicit schema to save a full pass over the file.