MCPcopy
hub / github.com/pandas-dev/pandas / _generate_range

Method _generate_range

pandas/core/arrays/period.py:323–334  ·  view source on GitHub ↗
(cls, start, end, periods, freq)

Source from the content-addressed store, hash-verified

321
322 @classmethod
323 def _generate_range(cls, start, end, periods, freq):
324 periods = dtl.validate_periods(periods)
325
326 if freq is not None:
327 freq = Period._maybe_convert_freq(freq)
328
329 if start is not None or end is not None:
330 subarr, freq = _get_ordinal_range(start, end, periods, freq)
331 else:
332 raise ValueError("Not enough parameters to construct Period range")
333
334 return subarr, freq
335
336 @classmethod
337 def _from_fields(cls, *, fields: dict, freq) -> Self:

Callers 5

_nbins_to_binsFunction · 0.45
period_rangeFunction · 0.45
date_rangeFunction · 0.45
timedelta_rangeFunction · 0.45
shiftMethod · 0.45

Calls 1

_get_ordinal_rangeFunction · 0.85

Tested by

no test coverage detected