Questions tagged [columnsorting]

Column sorting refers to any columns based technique that sorts a list of data based on its individual column values.

Column sorting refers to any columns based technique that sorts a list of data based on its individual column values.

375 questions
20
votes
7 answers

jQuery DataTables: how to sort by specific column?

Here's the page: http://csuvscu.com/ I need to sort by the Date Column, right now it needs to read Nov 6, Nov 5 and lastly Oct 7. How do I do this?
Snow_Mac
  • 5,169
  • 16
  • 50
  • 79
17
votes
3 answers

Formatting Lists into columns of a table output (python 3)

I have data that is collected in a loop and stored under separate lists that hold only the same datatypes (e.g. only strings, only floats) as shown below: names = ['bar', 'chocolate', 'chips'] weights = [0.05, 0.1, 0.25] costs = [2.0, 5.0,…
Jake Cannon
  • 173
  • 1
  • 1
  • 6
9
votes
2 answers

Perl6: Sorting Hash by Values and using kv

I'm looking at the following Data (in JSON) { "FValidation_pipelineMTHXT_v4.5.1_refLibV2": "concordance2/f", "FValidation_pipelineLPJL": "concordance2/c", "FCompetenceRuns": "concordance2/b", "FWGS": "concordance2/a", …
con
  • 4,303
  • 5
  • 19
  • 42
9
votes
2 answers

fast way to get index of top-k elements of every column in a pandas dataframe

I have a very large pandas dataframe with approximately 500,000 columns. Each column is about 500 elements long. For each column, I need to retrieve the (index, column) location of the top-k elements in the column. So, if k were equal to 2, and…
A. Arpi
  • 167
  • 1
  • 4
8
votes
5 answers

How to sort a group in a way that I get the largest number in the first row and smallest in the second and the second largest in the third and so on

So I have a df like this In [1]:data= {'Group': ['A','A','A','A','A','A','B','B','B','B'], 'Name': [ ' Sheldon Webb',' Traci Dean',' Chad Webster',' Ora Harmon',' Elijah Mendoza',' June Strickland',' Beth Vasquez',' Betty Sutton',' Joel Gill','…
8
votes
4 answers

How to sort pandas dataframe on json field

I have a data like this in Pandas dataframe id import_id investor_id loan_id meta 35736 unremit_loss_100312 Q05 0051765139 {u'total_paid': u'75', u'total_expense': u'75'} 35737 …
Jameel Grand
  • 1,903
  • 13
  • 30
6
votes
2 answers

Active Admin: how to add sortable on nested model's json column

How do I pass in a jsonb order query into the sortable: option for an Active Admin column? My model is structured like this: # User Model class User < ActiveRecord::Base has_one :level end # Level Model class Level < ActiveRecord::Base …
5
votes
3 answers

When to fill a sorted asp:GridView?

i've tried to ask this question a number of ways. It's a difficult question to answer because you have to understand what's going on. When do i fill a GridView? The nieve answer is during Page_Load, if not a PostBack: protected void…
Ian Boyd
  • 220,884
  • 228
  • 805
  • 1,125
4
votes
1 answer

writing csv in python pandas, need to change order of columns and add blank columns

I have imported a csv file into python and I'm using pandas. I need to output a new csv file containing only some of the data, and in a different order with blank columns. The new csv file will be used to import data from one system into, and the…
mattrweaver
  • 589
  • 2
  • 11
  • 29
3
votes
5 answers

Sort 2D List by Column Header in java

I am doing a simple Data Frame that can read and write CSV, and includes sorting function to sort by column. How can I sort the correct column by inputting the Column Header, and exclude the Column Header row from the sorting? This is a sample data…
Vaporeon
  • 33
  • 3
3
votes
2 answers

How to do an exact match followed by ORDER BY in PostgreSQL

I'm trying to write a query that puts some results (in my case a single result) at the top, and then sorts the rest. I have yet to find a PostgreSQL solution. Say I have a table called airports like so. id | code | display_name …
ElGatoGabe
  • 103
  • 5
  • 12
3
votes
1 answer

Pandas reverse column values groupwise

I want to reverse a column values in my dataframe, but only on a individual "groupby" level. Below you can find a minimal demonstration example, where I want to "flip" values that belong the same letter A,B or C: df =…
Marjan Moderc
  • 2,127
  • 18
  • 36
3
votes
1 answer

Sorting Footable rows by Date Column (gg/mm/aaaa)

I'm using footable library for showing table. Each row has a Date column, I would like to sort this table by the Date column (on column header click).
3
votes
1 answer

How to compact/rearrange a multi-dimensional array by removing null values

I have an array called $rows. The first row is the header. The first column is X (input signal), the other columns are Y1,Y2,Y3, etc. (output signals). For any X value some of Y values may be NULL. I print it with this code: $first_key =…
3
votes
1 answer

Want to auto sort a Google sheets spreadsheet on edit, but want to sort by date

Been looking around for a solution to this for a while and not finding anything that works, unfortunately. I have tried copying and pasting several bits of code but cannot get my sales pipeline sheet to automatically sort on edit of a date…
1
2 3
24 25