Questions tagged [difference]

This tag may refer to 1) the difference between two numbers (i.e. the difference between 5 and 10 is 5) or 2) the things that two or more particular objects do not share in common.

Use this tag for questions that deal with either of the following two topics:

  1. The difference between two numbers.
  2. What two or more particular objects do not share in common.

Related tags:

1970 questions
9
votes
3 answers

Count of number of elements between distinct elements in vector

Suppose I have a vector of values, such as: A C A B A C C B B C C A A A B B B B C A I would like to create a new vector that, for each element, contains the number of elements since that element was last seen. So, for the vector above, NA NA 2 NA …
richarddmorey
  • 976
  • 6
  • 19
9
votes
1 answer

Difference between sort(), rank(), and order()

What is the difference between sort(), rank(), and order() in R. Can you explain with examples?
Amit Gupta
  • 2,698
  • 4
  • 24
  • 37
9
votes
0 answers

Height and Y position values changed by .5 in storyboard

I'm working on an iOS project in Xcode (7.3) together with a colleague of mine. Lately we've noticed a weird thing occurring in storyboard files. Every time my colleague - let's call him Erik - opens a storyboard file, some UI elements' y and height…
Leverin
  • 739
  • 8
  • 24
9
votes
1 answer

Error when using "diff" function inside of dplyr mutate

I try to mutate new column to data.frame. When V column order changes from decreasing to increasing order, I use diff function inside of mutate to categorize them in new column H. V <- c(seq(30,-10,-10),seq(-10,30,10)) gr = rep(seq(1,3),each=10) df…
Alexander
  • 4,527
  • 5
  • 51
  • 98
9
votes
3 answers

Select groups with more than one distinct value

I have data with a grouping variable ("from") and values ("number"): from number 1 1 1 1 2 1 2 2 3 2 3 2 I want to subset the data and select groups which have two or more unique values. In my data,…
DK2
  • 651
  • 1
  • 7
  • 34
9
votes
1 answer

vim:what's the difference between buffers and args

I'm using vim,when I see the :args command ,I don't know the difference between args and buffers. in vim,I know buffers is important, so I thought :arg* is not important,maybe it's a "legacy command", but when I play the vim genius game ,I see…
Huhu
  • 121
  • 1
  • 5
8
votes
0 answers

Does the CLR have the same behavior in both the .Net Framework and the .Net Core?

Is CLR has the same behavior in both the .Net Framework and the .Net Core? Or at least how many differences are there (maybe it is possible to distinguish the main points which are different)? I am reading the CLR via C# (4th edition), Jeffrey…
iloveseven
  • 605
  • 4
  • 18
8
votes
1 answer

What is the difference between energy function and loss function?

In the paper A Tutorial on Energy Based Learning I have seen two definitions: Energy function E(X, Y) is minimized by inference process: the goal is to find such value of Y, such that E(X, Y) takes is minimal value. Loss function is a measure of a…
8
votes
1 answer

What are the differences between Generics, Views, Viewsets and Mixins in Django?

I am new to Django and Django-Rest. I am confused about when I should use these? what are their advantages and disadvantages? I have only seen this- http://www.cdrf.co The only thing I know is there are a lot of ways to do 1 thing. But this is…
pbreak
  • 81
  • 1
  • 3
8
votes
1 answer

Difference Between Oracle lnstant Client and Oracle Client

What is the Difference Between Oracle lnstant Client and Oracle Client ? Could you explain me ? Thanks
Melo
  • 95
  • 1
  • 1
  • 5
8
votes
7 answers

Remove one dataframe from another with Pandas

I have two dataframes of different size (df1 nad df2). I would like to remove from df1 all the rows which are stored within df2. So if I have df2 equals to: A B 0 wer 6 1 tyu 7 And df1 equals to: A B C 0 qwe 5 a 1 wer 6 s 2 …
Federico Gentile
  • 5,650
  • 10
  • 47
  • 102
8
votes
3 answers

JavaScript - difference between two time strings

I need to compare two different datetime strings (formed: YYYY-MM-DD'T'HH:mm). Here are the datetime strings: var a = ("2017-05-02T10:45"); var b = ("2017-05-02T12:15"); I've sliced the dates out of them so I only need the time (formed: HH:mm). var…
IlariM
  • 376
  • 1
  • 3
  • 16
8
votes
2 answers

How to find different elements of two time vectors?

Considering these two time vectors: a<-seq(as.POSIXct("2010-01-01 05:00:00"), as.POSIXct("2010-01-02 23:55:00"), by = '5 min') b<-seq(as.POSIXct("2010-01-01 00:00:00"), as.POSIXct("2010-01-03 23:55:00"), by = '10 min') How to get the different…
YQ.Wang
  • 1,090
  • 1
  • 17
  • 43
8
votes
5 answers

strip() vs lstrip() vs rstrip() in Python

I tried using rstrip() and lstrip() like so: >>> a = 'thisthat' >>> a.lstrip('this') 'at' >>> a.rstrip('hat') 'this' >>> a.rstrip('cat') 'thisth' What exactly are these methods doing? I expected 'thist' for the first case and 'that' for the second…
sans0909
  • 395
  • 7
  • 20
8
votes
2 answers

Select pairs of numbers with the minimum overall difference

Given n pairs of numbers, select k pairs so that the difference between the minimum value and the maximum value is minimal. Note that 2 numbers in 1 pair cannot be separated. Example (n=5, k=3): INPUT OUTPUT (return the index of the pairs) 5…
KonaeAkira
  • 236
  • 1
  • 11