All Questions
1,352
questions
1
vote
2
answers
48
views
data frame breakdown by year, rounding up by duration of each period
I have a data frame of county executives and the first and last years they served.
I am running a panel study with county-year as the unit of analysis. The date range is 2000 to 2009.
I will like to ...
1
vote
2
answers
37
views
dataframe breakdown by year
I have a dataset on county executives and their year of inaguration. I need break down which year each executive was inaugurated.
The problem is that the notation under the "year" variable ...
1
vote
2
answers
65
views
getting the latest date for a a duplicated item in r [closed]
I have the following dataset (below).
I am trying to get the latest SEnd value for each individual tag (see Desired output) where I have the Tag, Owner and the latest SEnd date only. Essentially I am ...
1
vote
3
answers
55
views
Python Pandas: update last dates values of parameters with simple dynamics grouped by id
Here's a dataframe, with some parameters for each id by some regular quarterly dates. It's originally shuffled randomly, but, at first, let say, it is sorted by fab_date and id.
import pandas as pd
np....
0
votes
1
answer
36
views
Count unique individuals in each month [duplicate]
I have a dataframe that looks something like this:
data.frame(
stringsAsFactors = FALSE,
species = c("species1","species1",
"species1",...
0
votes
2
answers
54
views
Return the name of a column which matches a date value
I have a data.frame with about 66k rows and 150 columns. For the purposes of this question, this is a sample. All columns are date objects.
structure(list(fixed_date = structure(c(19267, 19239, 19120, ...
0
votes
1
answer
32
views
thermal sum between two dates, from a daily data frame
I have a data frame with daily temperature data. I would like to calculate the sum in several columns, between two dates from a second data frame and create a output (results) in a new data frame.The ...
0
votes
2
answers
40
views
Average and sum between two dates, from a daily data frame
I have a data frame with daily temperature data. I would like to calculate the average between two dates from a second data frame and add the results in a new column.
The average temperature must be ...
-1
votes
1
answer
32
views
Select most recent date in a panel RStudio
I have a data frame which is a panel: I have different CLPs (it's like the ID of an event) repeated several times, one for each phase of the event: organization, set-up, start, end, clean-up.
Each ...
0
votes
1
answer
41
views
Filter Multiple Items on Different Conditions using pandas
I am attempting to filter a dataframe index based on two conditions, ID and DATE, where DATE will vary by ID.
An example of what would be filtering on, I have provided 'filt'
Is there a better way to ...
2
votes
2
answers
95
views
How to connect data points with line, where values are missing
I need to draw several biomarker changes by Date on one graph, but biomarker samples were measured in different dates and different times, so for example:
data = {
'PatientID': [244651, 244651, ...
0
votes
2
answers
46
views
How to handle duplicates using asfreq() function. Is there any other way to do this?
I have some hourly data on electricity generation from various sources in various countries. I download data from the ENTSO-E Transparency Platform website and found a problem with data inconsistency. ...
1
vote
2
answers
57
views
Create new date columns based on matching vector
I am trying to simulate visit schedules for participants in a study. I will start with a dataframe of participants and first visit dates, and my goal is to create columns with the dates of later ...
1
vote
3
answers
89
views
Counting number of days from event, till another event in R
data.frame(
scrape_date = as.Date(c("2023-01-01", "2023-01-02", "2023-01-03", "2023-01-04", "2023-01-05", "2023-01-06", "2023-01-07&...
0
votes
1
answer
26
views
How do I do right join with multiple conditions?
I have an example below where I need to perform a right join with multiple conditions:
1st dataframe:
df_1 <- data_frame(
dates = c(as.Date("2023-03-01"), as.Date("2023-03-05")...