Skip to content

Tag: dataframe

Pandas conditional counting by date

I want to count all orders done by each customer at each order date, to find out how many orders were done at the time of each order. Input: Expected output: The following code works but is extremely slow. Taking upwards of 10 hours for 100k+ rows. There is certainly a better way. Answer Try sort_values to ge…

Create a DataFrame from a XML File

im new to XML and i want to know how to create a dataframe in python from this XML file. I have the following code, it creates the DataFrame but when i tried to append the value of the row, i dont know why it keeps coming “None”. I dont know if i have to change de calling argument i.e