In Python it will be delivered to you as an object of class LaserScan.
Consider writing a separate filter node which takes “raw” LiDAR data (subscribes to /scan) and publishes “cleaned up” LiDAR data (publishes for example to /scan/clean).
A related approach is to subscribe to /scan and publish something like /scan/semantic that instead of just cleaning up the data also computes some mins and maxes in different directions of interest.