Skip to content

Commit 6ab626f

Browse files
committed
Merge pull request #11194 from jorisvandenbossche/tsplot-perf
PERF: compare freq strings (timeseries plotting perf)
2 parents 8ac1eab + a6379b6 commit 6ab626f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/src/period.pyx

+3-1
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,12 @@ def extract_ordinals(ndarray[object] values, freq):
439439
ndarray[int64_t] ordinals = np.empty(n, dtype=np.int64)
440440
object p
441441

442+
freqstr = Period._maybe_convert_freq(freq).freqstr
443+
442444
for i in range(n):
443445
p = values[i]
444446
ordinals[i] = p.ordinal
445-
if p.freq != freq:
447+
if p.freqstr != freqstr:
446448
raise ValueError("%s is wrong freq" % p)
447449

448450
return ordinals

0 commit comments

Comments
 (0)