Uncomment code

This commit is contained in:
LilyRose2798 2024-04-01 11:22:23 +11:00
parent 5a519bd80e
commit 87a75ebae0
1 changed files with 3 additions and 3 deletions

View File

@ -16,10 +16,10 @@ def convert_to_parquet(csv_path: Path, parquet_path: Path):
lf = pl.scan_csv(csv_path, schema={
"saddr": pl.String,
"rtt_us": pl.UInt64,
# "success": pl.UInt8
"success": pl.UInt8
})
# lf = lf.filter(pl.col("success") == 1)
# lf = lf.drop("success")
lf = lf.filter(pl.col("success") == 1)
lf = lf.drop("success")
lf = lf.with_columns(rtt_us=pl.col("rtt_us").clip(0, 0xFFFFFFFF).cast(pl.UInt32))
lf = lf.with_columns(saddr=pl.col("saddr").str.split_exact(".", 3).struct.rename_fields(["a", "b", "c", "d"]))
lf = lf.with_columns(saddr=pl.col("saddr").struct.field("a").cast(pl.UInt32) * 0x1000000 + pl.col("saddr").struct.field("b").cast(pl.UInt32) * 0x10000 + pl.col("saddr").struct.field("c").cast(pl.UInt32) * 0x100 + pl.col("saddr").struct.field("d").cast(pl.UInt32))