[Python] Sklearn or Pandas, impute missing values with simple linear regression

Discussão em 'Python' iniciado por Stack, Maio 4, 2025.

  1. Stack

    Stack Membro Participativo

    I have time series data, and I want to impute the missing data. I cant use mean of the column because I think it's not good for time series data.

    So I want simple linear regression to impute it

    Day, Price
    1, NaN
    2, NaN
    3, 1800
    4, 1900
    5, NaN
    6, NaN
    7, 2000
    8, 2200



    I prefer to do this using Pandas, but if there is no other way I'm ok to do it using sklearn :)

    Continue reading...

Compartilhe esta Página