空的DataFrame,按当前日期排序,以熊猫为单位

时间:2019-10-28 14:47:47

标签: python excel python-3.x pandas dataframe

请帮助我,运行时我需要按当前日期排序的数据:

  

空DataFrame

     

列:[DATE,TIME,FROM,TO,Vehicle,REQUESTOR]

     

索引:[]

这是我的代码:

import tkinter as tk

import datetime

from tkinter import *

import pandas as pd

class Root(Tk):

    def __init__(self):
        super(Root, self).__init__()
        self.geometry("900x500")
        now = datetime.datetime.now()
        print("Current date and time : ")
        print(now.strftime("%Y-%m-%d"))
        self.label1 = tk.Label(self, text=now.strftime("%Y-%m-%d"), font="Helvatica 20 bold") 
        self.label1.place(x=750, y=0)
        self.data = pd.read_excel(r'pandas_simple.xlsx', sheet_name="UNO")

        self.booleans = []
        self.booleans[:]
        self.numero1 = pd.Series(self.booleans)
        self.numero1 = self.data.DATE == now.strftime
        self.numero1.head()
        self.data[self.numero1]
        print(self.data[self.numero1])

        self.current = tk.Label(self, text=self.data[self.numero1], bg="ORANGE", width=68, height=13)
        self.current.place(x=1, y=3)

jona = Root()

jona.title("BOOKING CHORVA")

jona.mainloop()

1 个答案:

答案 0 :(得分:0)

这部分应该:

self.numero1 = self.data.DATE == now.strftime(“%Y-%m-%d”)

相关问题