multiple-columns

Python Dataframes merge multi match

Python Dataframes merge multi match Question: I’m new with Dataframe. I would like to kwon how (if possible) can I merge 2 Dataframes with multiple match For example [df1] date ZipCode Weather 2022-11-25 00:00:00 123456 34 2022-11-25 00:00:15 123456 35 2022-11-25 00:00:30 123456 36 [df2] date ZipCode host 2022-11-25 00:00:00 123456 host1 2022-11-25 00:00:00 123456 …

Total answers: 3

Problem with Unalignable boolean Series with two columns filter

Problem with Unalignable boolean Series with two columns filter Question: In this case I am working with 2 columns that are substracted from 2 Dataframes. The columns are ["# Externo","Nro Envio ML"]] My target is to recieve the numbers that exist in "# Externo" but no exist in"Nro Envio ML" , only that number/ or …

Total answers: 1

Pandas; Need to combine duplicate columns, and find the mean of another column

Pandas; Need to combine duplicate columns, and find the mean of another column Question: I have this data frame with about 200 rows, and I need to combine the duplicate writers columns, and then find the mean value of their viewership. How can I accomplish this? Below is a sample of the data frame. Viewership …

Total answers: 1

Pandas; Trying to split a string in a column with | , and then list all strings, removing all duplicates

Pandas; Trying to split a string in a column with | , and then list all strings, removing all duplicates Question: I’m working on a data frame for a made up TV show. In this dataframe, are columns: "Season","EpisodeTitle","About","Ratings","Votes","Viewership","Duration","Date","GuestStars",Director","Writers", With rows listed as ascending numerical values. In this data frame, my problem relates to two …

Total answers: 1

How to find common edges from a binary dataframe?

How to find common edges from a binary dataframe? Question: This is my dataset: Dept Cell culture Bioinfo Immunology Trigonometry Algebra Biotech Optics Biotech 1 1 1 0 0 1 0 Math 0 0 0 1 1 0 0 Physics 0 0 0 0 0 0 1 How I want my result: Dept 0 Biotech …

Total answers: 1

How to pivot multiple columns

How to pivot multiple columns Question: Input Table index income Education age1to_20 pcd 1 income_1 Education_0 1 A5009 2 income_2 Education_2 1 A3450 3 income_1 Education_0 1 A5009 4 income_3 Education_1 0 A3450 How do I convert this table into index income_1 income_2 INCOME_3 Education_0 Education_1 Education_2 age1to_20 1 A5009 0 0 A5009 0 0 …

Total answers: 4

Dynamically create columns from string with delimiter in Spark

Dynamically create columns from string with delimiter in Spark Question: I have a table like this: a | a_vector | 1 | 710.83;-776.98;-10.86;2013.02;-896.28; | 2 | 3 ; 2 ; 1 | Using PySpark/pandas, how do I dynamically create columns so that first values in vector go to "col1" and second values go to "col2" …

Total answers: 2

How can I find a word and print it along with his next word in Python

How can I find a word and print it along with his next word in Python Question: I have the following list: pre = ["unable to", "would not", "was not", "did not", "there is not", "could not", "failed to"] From dataframe column I want to find texts that have the words of the list in …

Total answers: 1

value counts not working with a column filter in Pandas

value counts not working with a column filter in Pandas Question: everyone I was trying to count the number of Yes answered in a column depending on the answer from another previous column to generate pie charts so I’m having problems with this because is giving me counts in boolean like in image below, (This …

Total answers: 2