Uncomment code
This commit is contained in:
parent
5a519bd80e
commit
87a75ebae0
6
ipmap.py
6
ipmap.py
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue