View Source LastfmArchive.Analytics.Commons (lastfm_archive v0.11.0)

Common data frame analytics functions.

Summary

Functions

Calculate stats for a single group such as "artist", "album".

Compute frequency for a columns subset, filter untitled albums.

Rank data frame by total plays count and return top n rows.

Types

Functions

Link to this function

create_facet_stats(df, df_source)

View Source
Link to this function

create_facet_stats(df, facet, index)

View Source
Link to this function

create_group_stats(df, group)

View Source
@spec create_group_stats(data_frame(), String.t()) :: data_frame()

Calculate stats for a single group such as "artist", "album".

Stats include:

  • years_freq: frequency of yearly occurrance per group
  • total_plays: total number of plays per group

The function also pivots and creates additional year columns with annual play counts per group.

@spec frequencies(data_frame(), group()) :: data_frame()

Compute frequency for a columns subset, filter untitled albums.

Link to this function

most_played(df, rows \\ 5)

View Source
@spec most_played(data_frame(), integer()) :: data_frame()

Rank data frame by total plays count and return top n rows.