select DISTINCT STORECODE, SUPPCODE from stocks
where suppcode = 'S2'
从这段代码中我得到了包含供应商代码'S2'的商店代码。
我想在哪里显示:
where suppcode != 'S2'
但是,当我运行这个时,我会得到其他商店代码。例如S1,S3,S4,S5,S6。我想只返回没有S2作为供应商的商店代码。
非常感谢!
答案 0 :(得分:0)
all_dates = []
df = df.reset_index()
for item in list(OrderedDict.fromkeys(df['date'])):
all_dates.append(datetime.strptime(item, "%Y-%m-%d"))
print(all_dates)
>>> [datetime.datetime(2013, 1, 2, 0, 0), datetime.datetime(2013, 1, 3, 0, `0), datetime.datetime(2013, 1, 4, 0, 0), datetime.datetime(2013, 1, 7, 0, 0), datetime.datetime(2013, 1, 8, 0, 0), datetime.datetime(2013, 1, 9, 0, 0), datetime.datetime(2013, 1, 10, 0, 0), ...,datetime.datetime(2018, 3, 26, 0, 0), datetime.datetime(2018, 3, 27, 0, 0), datetime.datetime(2018, 3, 28, 0, 0), datetime.datetime(2018, 3, 29, 0, 0), datetime.datetime(2018, 3, 30, 0, 0)]`