memoryfm.attachment#

memoryfm.attachment(sclog, by='track', freq='D', year=None, alpha=1)#

Compute Attachment Index from a ScrobbeLog

Attachment Index is always between 0 and 100.

Parameters:
sclogScrobbleLog

a memoryfm ScrobbleLog

bytrack, artist, album, default track

The field to use for calculating Attachment Index.

freqstr, pd.Period, default D

The time frequency to use for the weighted attachment index. For instance, “3D” means a attachment index is calculated once for every 3 days. one value for every two weeks. For a full description, see pandas period aliases

yearint, Optional

The year to use for filtering. If None or not passed, no filtering is done.

alphanp.float64, default 1

A positive floating point value, representing the order of Attachment Index.

Returns:
pd.Series

Returns a pandas series containing Attachment Index for each period.