Skip to content
Advertisement

Tag: pandas

PostgreSQL equivalent of Pandas outer merge

I am trying to do in Postgres the equivalent of Pandas outer merge, in order to outer merge two tables. Table df_1 contains these data: Table df_2 contains these data: So Table df_1 has one extra column (random_id) than df_2. Also, job_id 1711418 and worker_id 45430 exist in both df_1 and df_2. If I use the “outer merge” method in

Processing mulitple similar rows in Pandas

I have a dataframe pulled from a relational database. A one-to-many join has resulted in many similar rows with one column different. I would like to combine the similar rows but have the differing column data contained within a list, for each unique row. I am also able to change the SQL but I think this may be easier to

Is there a way to run posqresql queries in a pandas dataframe?

I have pandas dataframe like this : created_at lat long hex_ID 0 2020-10-13 15:12:18.682905 28.690628 77.323285 883da1ab0bfffff 1 2020-10-12 22:49:05.886170 28.755408 77.112289 883da18e87fffff 2 2020-10-13 15:24:17.692375 28.690571 77.323335 883da1ab0bfffff 3 2020-10-12 23:21:13.700226 28.589922 77.082738 883da112a1fffff 4 2020-10-13 15:43:58.887592 28.649227 77.339063 883da1a941fffff and I want to convert it like this created_at hex_id count 0 2020-10-28 22:00:00 883da11185fffff 4 1 2020-09-09 10:00:00

Advertisement