🚀
Finter
PlaygroundData Catalogue
Quick Start
Quick Start
  • Getting Started with Finter: A Quick Guide
  • Explore Finter
    • Finter Labs (Recommended)
    • Other Ways
      • Google Colab
      • Conda, venv, or Docker
      • Setting Up a .env File (Optional)
  • Framework
    • CM (Content Model)
    • AM (Alpha Model)
    • PM (Portfolio Model)
    • Simulatior
      • Target Volume Limit
    • Finter Cli Submission
      • Validation
      • GitHub Sync
      • [Legacy] JupyterLab Submission
      • [Legacy] Submission
  • MODELING
    • MetaPortfolio
      • Equal weight meta portfolio
      • Fixed weight meta portfolio
      • Risk parity meta portfolio
    • StrategicAssetAllocation
    • DateConverter
    • BuyHoldConverter
  • Supporting Tools
    • FileManager
    • Finter AI (alpha ver.)
    • Data
      • FinHelper
        • filter_unchanged
        • unify_idx
        • shift_fundamental
        • rolling
        • expand_to_gvkeyiid
      • ModelData
      • ID Table
      • ID Converter
      • Quanda Data
    • Evaluator
      • top_n_assets
      • bottom_n_assets
      • compare_with_bm
    • PortfolioAnalyzer
    • Email
Powered by GitBook
On this page
  • Description
  • Parameters
  • Returns
  • Example

Was this helpful?

Edit on GitHub
  1. Supporting Tools
  2. Data
  3. FinHelper

shift_fundamental

Description

Shift the financial unpivot CM by n quarters.

---------------------------
fiscal  pit         value
---------------------------
202001  2020-04-15  a
202002  2020-07-15  b
202003  2020-10-15  c
202003  2020-11-15  d
202003  2021-02-15  e
202004  2021-01-15  f
202102  2022-07-15  g
202103  2022-10-15  h
---------------------------

shift 1 quarter
↓
---------------------------
fiscal  pit         value
---------------------------
202002  2020-07-15  a
202003  2020-10-15  b
202004  2021-01-15  d
202004  2021-02-15  e
202103  2022-10-15  g
---------------------------

Note

  • On '2021-01-15' previous quarter value was 'd'(The value on 202003; 2020-11-15) Then when '2021-02-15' previous quarter value becomes 'e'

  • Because there is no 202101 pit and value, value 'f' is dropped.

Parameters

  • df (pandas.DataFrame): financial unpivot CM

  • periods (int > 0)

  • fiscal (str; ["quarter", "annual"]) : Default - 'quarter'

Returns

  • pandas.DataFrame

Example

# df_a is financial unpivot cm
df_a = FinHelper.shift_fundamental(df_a, periods=1)

Last updated 9 months ago

Was this helpful?