famafrench.FamaFrench.getkfNumFirms

FamaFrench.getkfNumFirms(self, freq, dt_start, dt_end, dim)[source]

Query number of firms in each portfolio from Ken French’s online data library at a given frequency and for a given sample period.

Parameters
  • freq (str) –

    Observation frequency of the portfolios. Possible choices are:

    • D : daily

    • W : weekly

    • M : monthly

    • Q : quarterly (3-months)

    • A : annual

  • dt_start (datetime.date) – Starting date for the dataset queried or locally retrieved.

  • dt_end (datetime.date) – Ending date for the dataset queried or locally retrieved.

  • dim (list, int) – Dimensions for sorting on each element in the list self.sortCharacsId.

Returns

kfNFirmsTable – Cleaned dataset queried from Ken French’s online library containing number of firms in each portfolio observed at frequency freq over sample period from dt_start to dt_end for a given portfolio sorting strategy.

Return type

pandas.DataFrame