Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

datetime

Find the closest date to a given date

August 17, 2022 by Magenaut

I have an array of datetime objects, and I would like to find which element in the array is the closest to a given date (e.g datetime.datetime(2014,12,16))

Categories Python, Q&A Tags date, datetime, python Leave a comment

Find the end of the month of a Pandas DataFrame Series

August 17, 2022 by Magenaut

I have a series within a DataFrame that I read in initially as an object, and then need to convert it to a date in the form of yyyy-mm-dd where dd is the end of the month.

Categories Python, Q&A Tags date, datetime, pandas, python Leave a comment

Python datetime object show wrong timezone offset

August 17, 2022 by Magenaut

I am try creating a datetime object in python using datetime and pytz, the offset shown is wrong.

Categories Python, Q&A Tags datetime, python, pytz, timezone Leave a comment

Getting today’s date in YYYY-MM-DD in Python?

August 17, 2022 by Magenaut

Is there a nicer way than the following to return today’s date in the YYYY-MM-DD format?

Categories Python, Q&A Tags datetime, python, python-datetime Leave a comment

Check if string has date, any format

August 17, 2022 by Magenaut

How do I check if a string can be parsed to a date?

Categories Python, Q&A Tags date, datetime, macos, python, string Leave a comment

Pandas: Subtracting two date columns and the result being an integer

August 17, 2022 by Magenaut

I have two columns in a Pandas data frame that are dates.

Categories Python, Q&A Tags datetime, int, numpy, pandas, python Leave a comment

How to convert a python datetime.datetime to excel serial date number

August 17, 2022 by Magenaut

I need to convert dates into Excel serial numbers for a data munging script I am writing. By playing with dates in my OpenOffice Calc workbook, I was able to deduce that ‘1-Jan 1899 00:00:00’ maps to the number zero.

Categories Python, Q&A Tags data-munging, datetime, excel, python Leave a comment

How do I create a datetime in Python from milliseconds?

August 17, 2022 by Magenaut

How do I create a datetime in Python from milliseconds? I can create a similar Date object in Java by java.util.Date(milliseconds).

Categories Python, Q&A Tags datetime, python Leave a comment

Generating random dates within a given range in pandas

August 17, 2022 by Magenaut

This is a self-answered post. A common problem is to randomly generate dates between a given start and end date.

Categories Python, Q&A Tags datetime, pandas, python, random Leave a comment

Create a day-of-week column in a Pandas dataframe using Python

August 17, 2022 by Magenaut

Create a day-of-week column in a Pandas dataframe using Python

Categories Python, Q&A Tags datetime, pandas, python Leave a comment
Older posts
Newer posts
← Previous Page1 … Page13 Page14 Page15 … Page20 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress