What I want to do is very simple. I would like to sort this data frame df:
df
Signal 1 18 2 0.043 3 549 4 9998 5 2.342
on signal to get this:
Signal 4 9998 3 549 1 18 5 2.342 2 0.043
It is important that the original row identifiers are preserved.
I tried sort(df$Signal)and df[sort(df$Signal),]but he gives me a list.
sort(df$Signal)
df[sort(df$Signal),]
Since dfthis is a function in packet statistics, I will call your data frame d.
d
order , drop=FALSE [, ( ). , .
order
drop=FALSE
[
d[order(d$Signal, decreasing=TRUE),, drop=FALSE] Signal 4 9998.000 3 549.000 1 18.000 5 2.342 2 0.043
Source: https://habr.com/ru/post/1532236/More articles:Поиск и замена какого-либо текста в строках в Python? - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1532232/bypass-array-is-too-big-python-error&usg=ALkJrhgOPPJBaEo9T7mFJC9WhJUUrpl0XwMax matplotlib matrix array size? - pythonWhy isn't the Composer project for Laravel running? - laravelhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1532235/should-i-replace-all-calls-to-pushback-with-emplaceback&usg=ALkJrhhbdwLTXZr8rDllbpnAF6zSkoNK1gCan you open the same file several times for writing? - c ++Java Swing -.dispose () method does not close JFrame - javaCreate a receipt during IOS7 verification - ios7value attribute for lxml.html - pythonPlacement syntax key could not be found in page editor - c #All Articles