Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 空数据框,按当前日期排序,以大熊猫为单位_Python_Excel_Python 3.x_Pandas_Dataframe - Fatal编程技术网

Python 空数据框,按当前日期排序,以大熊猫为单位

Python 空数据框,按当前日期排序,以大熊猫为单位,python,excel,python-3.x,pandas,dataframe,Python,Excel,Python 3.x,Pandas,Dataframe,请帮助我,我需要按当前日期排序的数据,运行时显示: 空数据帧 列:[日期、时间、从、到、车辆、请求者] 索引:[] 这是我的密码: 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(&

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

空数据帧

列:[日期、时间、从、到、车辆、请求者]

索引:[]

这是我的密码:

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()

在这一部分中,它应:


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

在本部分中,它应该:


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

好吧,我不太确定您在这里想要实现什么。。不能对空数据帧进行排序?请更清楚地说明您想做什么。我在这个文件“pandas_simple.xlsx”中有一个excel数据,我想按当前日期对它进行排序(因为其中有和dataframe name date),并在我的tkinter中显示数据。然后尝试
df.sort_值('date',升序=True,inplace=True)
,我真的不确定你在这里想要达到什么目的。。不能对空数据帧进行排序?请更清楚地说明您想做什么。我在这个文件“pandas_simple.xlsx”中有一个excel数据,我想按当前日期对它进行排序(因为其中有和dataframe name date),并在我的tkinter中显示数据。然后尝试
df.sort_值('date',升序=True,inplace=True)