distinct

Best away to distinct a list of objects by two fields equals with sqlalchemy

Best away to distinct a list of objects by two fields equals with sqlalchemy Question: I have some duplicated records in my database with different Ids, like: id | title | date |flag | ——–+—————+——————-+—–+ 2099|Test |2022-11-29 00:00:00| 1 | 2100|Test |2022-11-29 00:00:00| 1 | 2101|Test |2022-11-29 00:00:00| 1 | 2102|Test |2022-11-29 00:00:00| 1 | …

Total answers: 1

How to "select distinct" across multiple data frame columns in pandas?

How to "select distinct" across multiple data frame columns in pandas? Question: I’m looking for a way to do the equivalent to the SQL SELECT DISTINCT col1, col2 FROM dataframe_table The pandas sql comparison doesn’t have anything about distinct. .unique() only works for a single column, so I suppose I could concat the columns, or …

Total answers: 7

Pandas 'count(distinct)' equivalent

Pandas 'count(distinct)' equivalent Question: I am using Pandas as a database substitute as I have multiple databases (Oracle, SQL Server, etc.), and I am unable to make a sequence of commands to a SQL equivalent. I have a table loaded in a DataFrame with some columns: YEARMONTH, CLIENTCODE, SIZE, etc., etc. In SQL, to count the …

Total answers: 11