Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How can i arrange columns as per condition?

$
0
0

@rahulsemwal10 wrote:

My data set is
S1 S2 S3 S4
1 4 7 20
2 6 8 21
3 9 10 30

and i convert data as per condition that
sort as per maximum difference value between each column value

data after the condition should be like this

S4 S2 S3 S1
20 4 7 1
21 6 8 2
30 9 10 3

explanation:
the difference between max and min value
for S4 is 30 - 20 = 10,
for S2 is 9-4 = 5
for S3 is 10-7 = 3
for S1 is 3-1 =2
and the columns are sorted as per the difference value of max and min.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles