Questions tagged [period]

A period of time is an interval, a span of time. You can also use it for questions related to the actual punctuation mark.

508 questions
1
vote
3 answers

Initializing values for the first and last row following a resample operation?

Given for instance a DataFrame with 1h Period, I would like to set 0 & 1 values in a new column whenever a new 5h Period starts and finishes respectively. Let's consider this input data for instance: import pandas as pd from random import seed,…
pierre_j
  • 895
  • 2
  • 11
  • 26
1
vote
1 answer

Query XML Nodes Containing Periods In PowerShell

I have a web based application used to query a number of different servers. There is an XML file that contains all the other servers along with the ports used to communicate with those servers. If I query: $File.servers.add.parameters I can see a…
Christopher Cass
  • 817
  • 4
  • 19
  • 31
1
vote
0 answers

How to plot a period over period chart with 2 different timescales with matplotlib?

I have 2 different stock charts. I like to compare the relative development in 2 different periods which are not of same length. The attached code does that correctly allthough with inefficient code. What I can't solve is to plot to time axis for…
Chris
  • 21
  • 3
1
vote
1 answer

Error in Printing Period with JodaTime?

I've have a problem trying to print a given period between two dates. Let me show you the details, and then i'll put the code : Date a = May, 20th , Date b = June, 19th Period in between should be 30 days.(or 29, doesn't matter) But given the code…
josete
  • 357
  • 1
  • 3
  • 15
1
vote
1 answer

R: Calculating the number of occurrences within a specific time period in the past for each unique individual in a dataset in R

I'm attempting to tally the number of times an event occurred for a given individual within a specific period of past time. In this particular case, I need to know, for each new observation (which reflects a single scheduling request), how many…
James DeWeese
  • 159
  • 1
  • 8
1
vote
1 answer

How to isolate periods with outliers on dataframe

So I have a dataframe that looks like this : id epoch value duration 958 1819 2018-01-01 00:00:00.000 1 20 959 1820 2018-01-01 00:20:00.000 2 20 960 1821 2018-01-01 00:40:00.000 3 …
Jinter
  • 226
  • 2
  • 10
1
vote
1 answer

Bash script that can print all dates between two iso8601 time periods

I have the following work-in-progress script in bash. #!/bin/bash # usage: # ./script.sh period_ago() { if [[ $1 =~ P(([0-9]+)M)?([0-9]+)D ]]; then local months=${BASH_REMATCH[2]:-0} local…
Saffik
  • 911
  • 4
  • 19
  • 45
1
vote
1 answer

How to find out if a date is after the end of a period

In this dataset, I want to find out (element-wise) whether date happens after the end of the period given in week. import pandas as pd df = pd.DataFrame({ "week": pd.period_range('2018-03-01', '2018-05-01', freq='W'), "date":…
E. Sommer
  • 710
  • 1
  • 7
  • 28
1
vote
1 answer

pandas period_range - gaining access to the

pd.period_range(start='2017-01-01', end='2017-01-01', freq='Q') gives me the following: PeriodIndex(['2017Q1'], dtype='period[Q-DEC]', freq='Q-DEC') I would like to gain access to '2017Q1' to put it into a different column in the dataframe. I have a…
wiseass
  • 543
  • 2
  • 5
  • 11
1
vote
1 answer

How to calculate the sum of a date intervall in a data.frame?

I want to calculate the sum of the flooded days for a variable intervall of time. the end of the period is given in a vector or data.frame and I want different length of my time period, e. g. 4 days and 6 days. How can I create a code, which is…
Nesch
  • 77
  • 4
1
vote
3 answers

SQL request excluding periods of time

I need to get all DISTINCT users excluding those who are not available according to unavailability periods of time. The user table: +------+-----------+--------------------------------------+ | id | firstname | content …
London Smith
  • 1,622
  • 2
  • 18
  • 39
1
vote
1 answer

Check if a year is in PeriodIndex

I'm having a DataFrame which is indexed by PeriodIndex and need to check if the index contains a year. Here is a snippet of what I have tried so far: In [1]: import pandas as pd In [2]: period_ix = pd.period_range(start='2018-07-01',…
Luan Nguyen
  • 993
  • 6
  • 14
1
vote
2 answers

Get total days from Period

I have Period object which comes from api. I have to calculate total days it contains. I found many answers how to get days between two dates, but no one answers how I can get total days exactly from Period object. E.g: LocalDate start =…
Squeez
  • 919
  • 2
  • 12
  • 30
1
vote
0 answers

The Period of Data Using TI-BASIC

I'm in basic trigonometry and currently learning how to find equations having been given the data only. I understand the concept pretty well, but I usually make a program in a TI-BASIC for solving my homework because it helps me understand it at a…
1
vote
2 answers

Conditional interval periods in PHP

I'm creating a PHP app targetting companies (in Congo), ultimately helping them manage the employees and their statuses. The legal part is constructed in 3 parts, in order of priority: The labor code, The collective agreement, the rules of…
Max13
  • 919
  • 2
  • 9
  • 27