Pendulum is a Python package to ease datetimes manipulation. It provides classes that are drop-in replacements for the native ones (they inherit from them).
Questions tagged [pendulum]
67 questions
1
vote
1 answer
Pip package (pendulum 2.1) fails to install with FileNotFoundError
During the installation process of pendulum I get a FileNotFoundError exception.
I ran it multiple times and all of them failed. It did work for pendulum==2.1.1.
Collecting pendulum==2.1.2 (from -c…

Jorrick Sleijster
- 935
- 1
- 9
- 22
1
vote
1 answer
Not printing out the value of z and theta
I am solving two coupled ordinary differential equations using the 4th-order Runge-Kutta method. I am having trouble in printing the values of z as a result of applying this method. The source code is below for reference. Please, help me fix this…

Rafael Gomez
- 11
- 1
1
vote
0 answers
How to deserialize datetime from json using MongoEngine
I'm trying to deserialize a datetime from a JSON string into a pendumul datetime object using MongoEngine. Consider the following code
#!/usr/bin/env python3
import pendulum as pd
import mongoengine as db
TZ_EST =…

noibe
- 327
- 5
- 18
1
vote
1 answer
Nonlinear pendulum in R: Problem to obtain the exact evolution in time of the angle
I am working on a simple pendulum problem to obtain the evolution of the angle θ in a time interval after knowing a data set. To arrive at the solution, I am basing myself on the work of Meléndez et alt, arriving at the following exact expression…

kupaluf fulapuk
- 13
- 5
1
vote
1 answer
Change time of 'next_execution_date' on Airflow in 'BashOperator'
I am trying to launch a process through the Bash Operator.
bash =BashOperator(
task_id='Trigger some dag',
bash_command='airflow trigger_dag -e "{{ next_execution_date }}" some_dag_id',
dag=dag,
)
I know that Airflow…

Matipedia
- 15
- 5
1
vote
0 answers
Runge Kutta and PGPLOT
Hi guys when I use this code (makefile not included) I am supposed to be getting two sinusoidal outputs graphed on the same set of axes but for some reason although the output data is accurate the graph is not. In face its not even a smooth curve,…

Danielle Winckler
- 21
- 2
1
vote
0 answers
How to use pendulum as a base datetime library with Django?
I would like to use pendulum as a base datetime library with Django. So, a DateTimeField should work with pendulum objects, not datetime objects.
I have followed an example on pendulum's docs page and created a special field:
import pendulum
from…

adder
- 3,512
- 1
- 16
- 28
1
vote
2 answers
AttributeError: 'datetime.timezone' object has no attribute 'name' when trying to run Apache Airflow scheduler
I have just setup a new Ubuntu machine, created a Python3.6 venv and installed airflow. I can start the webserver but when I try to run airflow scheduler I keep getting this error:
File…

mbrochh
- 1,011
- 1
- 10
- 21
1
vote
3 answers
latest version of pendulum.Interval()?
I'm working with some code from a year or two ago and it has:
import pendulum
pendulum.Interval(minutes=1000)
This worked with pendulum version 1.5.0, but doesn't work with the latest version 2.0.5. Is there an equivalent of pendulum.Interval in…

wordsforthewise
- 13,746
- 5
- 87
- 117
1
vote
2 answers
Can't use pendulum to parse dates in Series, but works one by one
I'm trying to parse dates using pendulum. I have a TimeStamp date, so I did the following:
df['aux']=df['Date'].dt.date
df['p_date']=df.aux.apply(lambda x: pendulum.parse(x))
Which brings the following error:
AttributeError: 'DateTime' object has…

Juan C
- 5,846
- 2
- 17
- 51
1
vote
0 answers
Is there a Way to Get TZ Database Name from Python Pendulum Given Offset?
Python Pendulum Mavens,
In Python, when using the [awesome] date & time manipulation package, Pendulum, how can tzinfo (TZ Database Name; such as 'Europe/London', 'Australia/Melbourne', etc.) be determined based on, or as a function of, UTC Offset?…

Plane Wryter
- 1,299
- 1
- 11
- 14
1
vote
1 answer
Airflow error with pandas: AttributeError: 'Pendulum' object has no attribute 'nanosecond'
I have a pandas.DataFrame df with df.index which yeilds something like this:
DatetimeIndex(['2014-10-06 00:55:11.357899904',
'2014-10-06 00:56:39.046799898',
'2014-10-06 00:56:39.057499886',
'2014-10-06…

Newskooler
- 3,973
- 7
- 46
- 84
1
vote
1 answer
Pendulum. Period instance. How to get hours from it
No matter what I put after the period a get 0. Why?
import pendulum
home = 'Europe/Berlin'
away = 'America/New_york'
a = pendulum.now(home)
b = pendulum.now(away)
print(a)
print(b)
dif = b.diff(a)
print (dif)
di = dif.in_hours()
print (di)
d =…

ogeretal
- 509
- 4
- 12
1
vote
1 answer
Human datetime diffs with Pendulum
I've recently stumbled upon this awesome pendulum "datetimes made easy" library.
It has a very nice feature of displaying "human like" diffs between datetimes:
In [1]: import pendulum
In [2]: now = pendulum.now()
In [3]: future =…

alecxe
- 462,703
- 120
- 1,088
- 1,195
0
votes
1 answer
Pendulum in Unity, sync with system clock (seconds)
I have to make a Pendulum sync with system time.
It has to be right in the middle of the swing when the second ticks in the clock.
I made this script, but its not sync.. it swings ok, but it depends on when I click play if its sync or not, and thats…