Top "Python-datetime" questions

Python's built-in datetime module provides classes for manipulating dates and times in both simple and complex ways.

timedelta error with numpy.longdouble dtype

I have times with dtype numpy.longdouble and when I'm trying to use that values with timedelta function I've got …

python numpy types timedelta python-datetime
How to convert datetime from string format into datetime format in pyspark?

I created a dataframe using sqlContext and I have a problem with the datetime format as it is identified as …

datetime apache-spark pyspark spark-dataframe python-datetime
Pandas: Cannot convert type <class 'pandas.tseries.index.DatetimeIndex'> to Timestamp

I got the following error message when trying to slicing a pandas dataframe using labels. triggerDate = dat.loc[dat.Close &…

pandas numpy python-datetime datetimeindex
How can I get the first day of the next month in Python?

How can I get the first date of the next month in Python? For example, if it's now 2019-12-31, …

python python-datetime
What's the most elegant way to get the end of the day (datetime)?

I'm currently writing some reporting code that allows users to optionally specify a date range. The way it works (simplified), …

python python-datetime
How to handle times with a time zone in Matplotlib?

I have data points whose abscissas are datetime.datetime objects with a time zone (their tzinfo happens to be a …

python matplotlib plot timezone python-datetime
Why do I get an AttributeError when I use scatter() but not when I use plot()

I wish to plot using Matplotlib/pylab and show date and time on the x-axis. For this, I'm using the …

python matplotlib python-datetime