Calculate bins given data
(self, data: Series | DataFrame, bins)
| 93 | return bins |
| 94 | |
| 95 | def _calculate_bins(self, data: Series | DataFrame, bins) -> np.ndarray: |
| 96 | """Calculate bins given data""" |
| 97 | nd_values = data.infer_objects()._get_numeric_data() |
| 98 | values = nd_values.values |
| 99 | if nd_values.ndim == 2: |
| 100 | values = values.reshape(-1) |
| 101 | values = values[~isna(values)] |
| 102 | |
| 103 | return np.histogram_bin_edges(values, bins=bins, range=self._bin_range) |
| 104 | |
| 105 | # error: Signature of "_plot" incompatible with supertype "LinePlot" |
| 106 | @classmethod |
no test coverage detected