Questions tagged [unique-values]

This tag is for questions involving values which are only one of its kind; unlike anything else.

173 questions
1
vote
1 answer

PHP & MySQL: Get all values from a table?

I'm trying to run this MySQL code in PHP. SELECT DISTINCT teamid FROM teammembers INNER JOIN teams WHERE teams.id = teammembers.teamid If I run this code in SQL, I get around 20 different values, and I would like to save this unique values in an…
user2077474
  • 353
  • 1
  • 6
  • 15
1
vote
2 answers

How to sort nested lists into seperate lists with unique values in python?

I have two variables: unique_val = [1,2,3] nested_list = [['name1',1],['name2',1],['name3',3],['name4',2],['name5',2],['name6',3]] Basically I want separate lists of the names at each unique value. I struggled to put together a set of nested for…
sTr8_Struggin
  • 665
  • 2
  • 11
  • 27
0
votes
0 answers

how to target the second one with the first one and get another sheets with the results

I have two sheets. The first one (document 1 as picture attached) contains only one colums with has unique number for each line (key). the second sheets (document 2 as picture attached) has multiple colums (name, adress...). I want to keep only the…
0
votes
1 answer

Pandas find whether cell has any value and if yes save the entire row to new dataframe

I have 284 dataframes where I need to iterate over the last 20 rows and if specific columns have any value then copy that entire row to a new dataframe. I get the desired result through the following: …
0
votes
1 answer

How to remove unique value check in Surveyjs questions?

when using Surveyjs creator, I often do some very basic maths operations with answers values. For example, if questions have 4 different answer options, I set their values to (1,2,3,4), regardless of their labels (what appears to the user). Then I…
0
votes
0 answers

how can we read the key and value pair from pdf using python , if data present with space

example file how to read the key and values if data separated with space? expecting values like Apartment[1212,331] , City=['',''] or [column name ] [values
0
votes
0 answers

How to best avoid unique value error w/ R package 'iml'

unfortunately I cannot share my data-set and my problem is data-set related, so a bad starting place I guess... but maybe someone's got a hint anyway? I'm starting with a data-set called input.rf which I am splitting into train and test as…
MarkH
  • 122
  • 9
0
votes
2 answers

Merging unique values from two different columns into a list

How do I merge the unique values in columns A and B from df into list? id A B 1 x k 2 y x 3 x l 4 x k This is what I am trying to achieve: list = ['x', 'y', 'k', 'l'] Failed attempt: list =…
chuachu
  • 23
  • 5
0
votes
0 answers

Finding the index of the last element that gets repeated consecutively (Javascript)

PROBLEM I'm working on a codewars problem where I'm supposed to find the peaks of an array. For example, [4, 9, 3, 2, 1] => 9 would be considered a peak because the values before and after it are lower than it. I've been able to identify the peak…
0
votes
1 answer

Create new unique value in column

I have a (MYSQL) table in the following format; assume the name of the table is mytable: id name group 123 name1 1 124 name2 2 125 name3 1 126 name4 id is unique and auto-increments. name is a unique string, group is just an…
Hein
  • 174
  • 1
  • 10
0
votes
0 answers

How to remove duplicate date values in pyspark prioritize non null values

This is my pyspark dataframe where you can row number 2 and 3 are duplicates if we exclude the column date2_chek, i would like to keep the columns with date having 2019-05-15, and the other to be…
0
votes
2 answers

Using Google Sheets, identify a grouping of rows that have a unique column value

I'm trying to find a way to solve a problem like this: Given the following data in a Google Sheet: Recipe Ingredient Sequence. Waste Chicken Soup Celery. 1. 5% Chicken Soup Carrots. 2. 3% Chicken Soup Stock. …
0
votes
1 answer

python Ranking on rows having same value is giving random ranking not as ascending = False

Here is df, I want to Rank on value on group "Id" , ranking within class df['Rank']=df.groupby(["Id"])[' value'].rank(ascending=0) Sample df Expected Result Expected Result Result what I get from above code Result what I get from above code Above…
0
votes
1 answer

R: How to return unique values between columns with multiple values per cell?

I have a dataframe with multiple values per cell, and I want to find and return the values that are only in one column. ID <- c("1","1","1","2","2","2","3","3","3") locus <- c("A","B","C","A","B","C","A","B","C") Acceptable <- c("K44 Z33 G49","K72…
0
votes
2 answers

SQL how to count unique values that meet specific criteria, and exclude them from the count if their repeating duplicates don't meet my criteria

I have a table with user_id's and number of impressions they received during a certain period of time. A new record is added to the table when there is a new impression. Ex…