Błąd pandas: FutureWarning: The default value of regex will change from True to False in a future version.

0

Próbuję wykonać poniższy kod ale dostaję błąd:

df_clean = (
    df
    .rename(columns=lambda x: x.lower().replace(' ', '_')) # Normalize column names
    .loc[lambda x: x['supplemental_video_type'].isnull()] # Remove supplementals (trailers, teasers, etc)
    .assign(
        start_time     = lambda x: pd.to_datetime(x['start_time']),
        start_time_kz  = lambda x: x['start_time'] + pd.DateOffset(hours=1), # Convert to UTC +1 (Poland, Warsaw)
        duration       = lambda x: pd.to_datetime(x['duration'], format='%H:%M:%S'),
        duration_hours = lambda x: x['duration'].dt.hour + x['duration'].dt.minute / 60,
        title_clean    = lambda x: x['title'].str.replace(': (?i)(part|season|volume|limited series|series|chapter)(.*)', '').str.strip(),
        start_date     = lambda x: x['start_time_kz'].dt.date,
        start_hour     = lambda x: x['start_time_kz'].dt.hour,
        is_holiday     = lambda x: x['start_time_kz'].dt.weekday >= 5,
    )
    [['profile_name', 'start_time_kz', 'is_holiday', 'start_date', 'start_hour', 'duration_hours', 'title', 'title_clean']]
)

df_clean.sample(5)

FutureWarning: The default value of regex will change from True to False in a future version.
  title_clean    = lambda x: x['title'].str.replace(': (?i)(part|season|volume|limited series|series|chapter)(.*)', '').str.strip(),
  

ma ktoś pomysł jak mogę to naprawić?

0

FutureWarninig to ostrzeżenie, jaki jest błąd?

1 użytkowników online, w tym zalogowanych: 0, gości: 1