All Questions

552
votes
16answers
308717 views

Access / process (nested) objects, arrays or JSON

I have a (nested) data structure containing objects and arrays. How can I extract the information, i.e. access a specific or multiple values (or keys)? For example: var data = { code: 42, it...
63
votes
18answers
291859 views

How do I remove objects from an array in Java?

Given an array of n Objects, let's say it is an array of strings, and it has the following values: foo[0] = "a"; foo[1] = "cc"; foo[2] = "a"; foo[3] = "dd"; What do I have to do to delete/remove al...
46
votes
6answers
25300 views

Split delimited strings in a column and insert as new rows

I have a data frame as follow: +-----+-------+ | V1 | V2 | +-----+-------+ | 1 | a,b,c | | 2 | a,c | | 3 | b,d | | 4 | e,f | | . | . | +-----+-------+ Each of the alphabet i...
3
votes
1answers
16906 views

jQuery jqGrid Show message when an edit row is complete

I am following this tutorial here http://www.trirand.com/blog/jqgrid/jqgrid.html in LiveDataManipulation->EditRow My grid receive data from script a.php. After the user can modify this data by the jq...
38
votes
7answers
30624 views

Read a CSV from github into R

I am trying to read a CSV from github into R: latent.growth.data <- read.csv("https://github.com/aronlindberg/latent_growth_classes/blob/master/LGC_data.csv") However, this gives me: Error in f...
11
votes
3answers
92113 views

Converting String Array to an Integer Array

so basically user enters a sequence from an scanner input. 12, 3, 4, etc. It can be of any length long and it has to be integers. I want to convert the string input to an integer array. so int[0] woul...
3
votes
3answers
2714 views

Flatten a column with value of type list while duplicating the other column's value accordingly in Pandas

Dear power Pandas experts: I'm trying to implement a function to flatten a column of a dataframe which has element of type list, I want for each row of the dataframe where the column has element of t...
2
votes
3answers
7332 views

Finding maximum value of one column (by group) and inserting value into another data frame in R

All, I was hoping someone could find a solution to an issue of mine that isn't necessarily causing headaches, but, as of right now, invites the possibility for human error in creating a data set for ...
6
votes
3answers
6584 views

Assign value to group based on condition in column

I have a data frame that looks like the following: > df = data.frame(group = c(1,1,1,2,2,2,3,3,3), date = c(1,2,3,4,5,6,7,8,9), value = c(3,4,3,4,5,6,6,4,9)) >...
4
votes
3answers
2385 views

Create a variable capturing the most frequent occurence by group

Define: df1 <-data.frame( id=c(rep(1,3),rep(2,3)), v1=as.character(c("a","b","b",rep("c",3))) ) s.t. > df1 id v1 1 1 a 2 1 b 3 1 b 4 2 c 5 2 c 6 2 c I want to create a third ...

Previous Next