(df, index, columns, values)
| 455 | |
| 456 | |
| 457 | def pivot_count(df, index, columns, values): |
| 458 | # we cannot determine dtype until concatenationg all partitions. |
| 459 | # make dtype deterministic, always coerce to np.float64 |
| 460 | return pd.pivot_table( |
| 461 | df, |
| 462 | index=index, |
| 463 | columns=columns, |
| 464 | values=values, |
| 465 | aggfunc="count", |
| 466 | dropna=False, |
| 467 | observed=False, |
| 468 | ).astype(np.float64) |
| 469 | |
| 470 | |
| 471 | def pivot_first(df, index, columns, values): |
nothing calls this directly
no test coverage detected