admin管理员组

文章数量:1558069

pandas使用query函数查询指定日期索引之前对应的dataframe数据行(select rows where date index before a certain date)

目录

pandas使用query函数查询指定日期索引之前对应的dataframe数据行(select rows where date index before a certain date)

 #仿真数据

#pandas使用query函数查询指定日期索引对应的dataframe数据行(select rows using a single date in dataframe)

 #pandas使用query函数查询指定日期索引之前对应的dataframe数据行(select rows where date index before a certain date)


 #仿真数据

import pandas as pd
import numpy as np

data = {'产品':['肉类','盐铁','纺织','木材']*2,
        '年份':[1046,1046,1046,1046,1047,1047,1047,1047],
       '诸侯':['秦','齐','楚','秦','秦',&#

本文标签: 函数索引日期数据pandas