Skip to content
Advertisement

Tag: pandas

How to replace irrelevant data into mean values?

Let’s say I have 600,000 data points in column for age. In the data there are values 0 and -1, which is not relevant for age. How can I change both 0 and -1 values in my data to the column mean value using python? The code so far: Answer You can find the mean separatly and then use the

put two columns from two different datasets together into one column

I have two dataframes df1 name Elias David Simon Manuel and a second df2 name Gabriel Brian Simona Danielle Dilara Martin David Simon I one to put them into one column I expecting an output like these: name Elias David Simon Manuel Gabriel Brian Simona Danielle Dilara Martin where every name occur once, so remove also duplicates. i tried these

Why is pandas broadcast formula is skipping rows

I have a dataframe and I’m doing tons (20+) of calculations creating new columns etc. All the calculations work well, including the calculation in question except for 2 rows out of roughly 1,000. The rows are not adjacent to one another and I can’t find anything remarkable about these two specific rows the calculation seems to be skipping. The data

How to filter based on id which contains specific name in another column in an excel file using Python

I have a excel file containing three columns as shown below, ID Name Date 1136 GG Daubringen 2019-04-08 1136 Manheinm 2020-06-16 1136 Manheinm Streitkof 2020-07-24 1136 Staufenberg 2020-08-15 1136 Stürcken 2021-03-05 1136 Stürcken (FTTH) 2021-09-13 1234 Lerbeck 2019-04-18 1234 BAd oyehausen 2020-06-26 1234 Werre Park 2020-07-14 1234 Werre Park (FTTH) 2020-08-25 1234 Werre Park (FTTH) 2021-03-15 1234 Bad oyehausen 2021-09-23

Advertisement