Skip to content
Advertisement

Tag: database

dedup records(window function pandas)

Hi I am looking to dedup my records ordered by cancel date so I will only be interested in the most recent record. sample data id cancel_date type_of_fruit 1 2021-03-02 apple 1 2021-01-01 apple 2 2021-02-01 orange expected output id cancel_date type_of_fruit 1 2021-03-02 apple 2 2021-02-01 orange I wrote the SQL way but I have to implement this logic

Django Python annotate ManyToMany Relationship with additional information

my problem is the following. I have two models in the database, which I link together using a ManyToMany relationship. For the admin page I currently use “admin.TabularInline” to bind different objects to one via the graphic. I still want to specify an order in the connections, preferably numbers which represent an order for processing. A bit more figuratively described

I need help formating this data

I have data like this The problem is some data is not in the format like this As you can see in the “local,hometown” there are 3 commas, I want to delete one of them so the data become like this This is just an example to the problem in my data there could be more than 3 commas and

How do I get multiple rows from django database?

Hello I am trying to create an employee attendance program and I want to make it so that the employees can see the total hours they worked. This is the code that creating the problem: The error I get is and if I use it shows an error that says Answer You must use filter and iterate over results as

Advertisement