【问题标题】:how can I slice values in one column?how can I slice values in one column?
【发布时间】:2022-11-20 13:27:53
【问题描述】:

I need only values but not date and time.. How can I separate them both

test1['predicted_mean'] = test1['predicted_mean'].apply(lambda x: x[20:]) test1

【问题讨论】:

  • Can you add what your expected output should look like?

标签: python time-series slice


【解决方案1】:

The date time values are not included in the predicted_mean column. Instead, it is an Index for the data frame you are searching for. If you don't want to see the date-time values, reset your index. That should solve your problem.

test1 = pd.DataFrame(y)
test1.reset_index(drop=True, inplace=True)

【讨论】:

    猜你喜欢
    • 2022-12-01
    • 2022-12-01
    • 2022-12-27
    • 2022-12-01
    • 2022-12-27
    • 2022-12-02
    • 2022-12-27
    • 2022-11-09
    • 2022-12-01
    相关资源
    最近更新 更多