Questions tagged [data-management]

312 questions
-1
votes
1 answer

R: Select rows with two closest measurements by groups

I have a large dataset in R where each subject (Label: 1, 2, 3,...) gets scanned 2 or more times for fat mass, lean mass, etc. at several time points (Comments: PRE F1 BMR, POST F1 BMR,..). Some scans are erratic, so we can't just average all of…
celow
  • 75
  • 1
  • 6
-1
votes
3 answers

select columns from dataframe where groups of samples are nonzero

I have a sample (rows) by species (columns) dataframe. And a column in another dataframe that codes the samples into groups. I want to select all of the columns where all of the samples in any of the groups have a nonzero value. species…
thermophile
  • 143
  • 1
  • 7
-1
votes
1 answer

Copy & Paste Information without f.read?

I am trying to copy and paste information from bytes X to Y from a huge data file to a new file. I got X and Y by using f.readline() and f.tell(). Is there a faster way to do this then the code below. import os a = 300 # Beginning Byte Location b…
-1
votes
2 answers

UITableView removing and adding rows

I have an NSMutableArray containing sequential numbers 1,2...,n and have a UITableView that displays cells vertically ascending and in order. How would I go about deleting a row, m between 1 and n, both visually and in the data, as well as in the…
rolling_codes
  • 15,174
  • 22
  • 76
  • 112
-2
votes
2 answers

Setting reference to bool equal to stack.top of a stack of booleans throws a bad access error. Can't figure out why it's happening

The following code is in a function and result is a reference to a bool value. trueValues and false Values are sets of chars that either result in a true or false statement. stack operandStack; for (int k = 0; k < postfix.size(); k++) { …
Ash Bal
  • 9
  • 1
-2
votes
1 answer

using grep -E to find peoples last names that begin with S but not include them is their first names begin with S

Find people whose last name begins with S in the people.txt file (Your expression should match the entire last name, not just the initial S, and only capital S qualifies). Ensure that the first names that begin with S are not included. the…
Luca
  • 55
  • 1
  • 7
-2
votes
1 answer

Add a column to a dataframe that references corresponding numbers/characters

I hope one of you can help me - I have been trying loads of different ways of doing this and can't seem to find the right answer. I am fairly new to R, but have been writing a script to format some data that I have. Ultimately, I will want to run…
KatySpi
  • 1
  • 1
-2
votes
2 answers

Is it better to read a data from file or database?

In my application, the customer will be given a set of 5 choice based questions. Based on the answers, he will get an offer. The answer choices and offers are mapped in the following way. [1,3,2,5,4] - Offer No.5, [1,1,1,2,1] - Offer No.2 Totally…
-2
votes
1 answer

new overlapping variable

I wasn't sure what to title this. I have a dataset of people, years, and activities df <- data.frame("id" = c("1", "1", "1", "2", "2","3"), "years" = rep(1971, 6), "activity" = c("a","b","c","d","e","e")) id years activity 1 …
crock1255
  • 1,025
  • 2
  • 12
  • 23
-3
votes
2 answers

Sum rows by group with condition in R

I have a dataset in R like this one: and I want to keep the same dataset with adding a column that gives the sum rows by ID when A=B=1. This is the required dataset: I tried the following R code but it doesn't give the result I…
Ruser-lab9
  • 193
  • 1
  • 12
-3
votes
1 answer

Serialization to file + encryption + decryption + data management. All in 1 solution

The question is more generally from a constructive point and realization but I'd be grateful for example or link with example (not only theory). The idea is as follows: Everything should be done locally. Any library whatsoever is allowed but whole…
ptrs
  • 1
  • 2
-3
votes
2 answers

ruby sorting a multidimensional array of mixed classes by last value, a string

So I grab a bunch of information from a few databases to get an array of values, their names and order being: ['type', 'baseid', 'lotid', 'split', 'sub', 'sequence', 'resourceid', 'user1', 'user2', 'part', 'department'] So I have an array of…
1 2 3
20
21