Questions tagged [unique-values]

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

173 questions
2
votes
3 answers

Get unique values of a Javascript array

I am trying to write a function in JavaScript to get the unique values ​​of an array, but my code does not work correctly. I know there are other better and simpler ways to do it, but I don't understand why my code doesn't work and I want to…
2
votes
1 answer

How to understand the code in post on "Getting unique values in Excel ..."?

Referring to answered Jun 27 '13 at 7:43 by totymedli and answered Apr 13 '16 at 0:53 by Meir Shachar I do prefer the VBA solution although the OP did not ask for one. However, I am able to parse and understand most of the linked responses above,…
McScreech
  • 23
  • 3
2
votes
2 answers

How to add an array into an in cell dropdown from a scripting dictionary?

I have a data dump from different application. I want to get unique values from a singular column in the data dump (which has variable length). Once I have the unique values I want them to be called into an .incelldropdown from data validation. I've…
2
votes
1 answer

Objective-C When I sort a list of values in one column, I want the name of those values sorted alphabetically

In one column of a table view, I have a list of names that are by default sorted alphabetically. But then I have a column of values that correspond to the names, and when I sort those values instead of alphabetically, ascending or descending, I have…
2
votes
1 answer

Determining if string contains same word more than once using Python?

I have strings with owner names and I need to identify whether they contain a last name twice. For example, I may have an owner name that reads "BENNETT MCCARL & ARNETTE BENNETT". I would like to return True if any word is found in the string twice,…
Kristen
  • 31
  • 2
2
votes
7 answers

How can I shorten my code with isset values

Im am so lost. Can anyone explain how i can shorten this code. I have hundreds of these! I submit a form with input value. Whenever i dont fill in a value, i get an error. So i made these isset blocks to prevent returning the error. But i seem so…
user5565111
2
votes
1 answer

How to only ready real values in a set

This might be a simply question but I haven't figured it out. I am writing a simple loop. v6<-c() > aa [1] 1 4 8 9 10 12 15 16 17 18 19 20 21 25 29 30 38 [18] 39 46 47 48 49 52 53 54 60 65 69 73 75 81 82 83 …
Noah Xu
  • 167
  • 3
  • 11
2
votes
1 answer

NetLogo test for shared turtles-own variable

I am trying to produce a NetLogo model to simulate competition for wood fuel. The model consists of two turtle breeds: "households" and "trees" distributed randomly over the world. Households-own [ fuel-store target radius ]. When fuel-store = 0,…
1
vote
1 answer

Count Distinct Values Based on Certain Values on Certain Column

I have a pandas dataframe that looks like this: name category status John student yes Jane employee no Elijah student no Anne student yes Elle employee no I want to count the number of each categories that have status 'yes' I…
1
vote
2 answers

How to concatenate all the rows linked with a same id into one row? consedring null values

I'm trying to concatenate all rows for same ID, the rows for a ID can have null or empty value: country value FR NULL FR 1 FR 3 MA 5 MA NULL MA 4 ES 9 ES 10 ES NULL I would like to consider this case in my query to get…
Reda El
  • 11
  • 2
1
vote
1 answer

Python: cannot iterate over elements, if several identical elements stay in a row

I'm a beginner, so sorry for such question. I would like to iterate over the array and find unique values. However, it doesn't iterate further than "A". How could I solve it? Thank you a lot in advance! Code -> def letters_learned_today(word): …
1
vote
1 answer

assigning multiple, different values in JS function

I'm working on a side project and I've stumbled across an issue I'm not sure how to resolve. I'm still on the basics and beginner level JS. I'm trying my hand at developing a ticketing system, working through one issue at a time as I think of how I…
emcee1342
  • 47
  • 7
1
vote
2 answers

Count the ones in select row of cells but skip the elevens

Example Data & Expected Results I have a row of data and I want make a count on a specific subset of cells that contain the value of 1. I want to ignore numbers that do not have a value of 1 even though they may contain ones such as 11, 21, 120…
GregF
  • 25
  • 5
1
vote
0 answers

Powershell randomize matrix (two dimensions 2D array) to unique column values

Let's say I have the following matrix arr1[0,$i] = 0,0,0,0,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3 arr1[1,$i] = 0,0,0,1,1,1,1,1,2,2,2,3,3,3,4,4,4,4,5,5 arr1[2,$i] = 0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,2,2,2 arr1[3,$i] =…
1
vote
0 answers

One hot encoding with different unique value in Pyspark

Basically this is my problem: I'm trying to implement a LSH solution with spark, but to do that I need that both Training and Test have the same columns in the same order. Second problem, I have different unique values in training and test. For…
ianux22
  • 405
  • 4
  • 16
1
2
3
11 12