Catalog.bin_magnitudes#
- Catalog.bin_magnitudes(delta_m: float = None, inplace: bool = False) Catalog | None#
Rounds values in the
magnitudecolumn of the catalog to a given precisiondelta_m.- Parameters:
delta_m – The size of the bins to round the magnitudes to.
inplace – Whether to perform the operation in place on the data.
- Returns:
catalog – Catalog with rounded magnitudes.
Examples
>>> import pandas as pd >>> from seismostats import Catalog >>> cat = Catalog.from_dict({ ... 'longitude': [42.35, 1.35, 2.35], ... 'latitude': [3.34444, 5.135, 2.134], ... 'magnitude': [1.02, 2.53, 3.99] ... }) >>> cat.bin_magnitudes(delta_m=0.1) longitude latitude magnitude 0 42.35 3.34444 1.0 1 1.35 5.13500 2.5 2 2.35 2.13400 4.0