Date time as index

    0

    0

    Wyx Smrf

    time_series

    Use date time as index, highly preferred for time series analysis.

    Library: Pandas

    Filename pattern: .ipynb, .py

    import pandas as pd 
    
    params = {'dataframe': df,
              'date_colname': 'Datetime'}
    
    def date_to_index(dataframe, date_colname):
      dataframe = dataframe.set_index(date_colname)
      dataframe.index = pd.to_datetime(dataframe.index)
      return dataframe
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.