Skip to main content

All Questions

0 votes
1 answer
46 views

Rendering datetime and proper formatting

I have a Django project to keep track of tasks in an office environment. I have this model for tasks, and it has a finish_date attribute that is assigned as soon as I access the route to do the ...
Diego Freire's user avatar
-1 votes
1 answer
69 views

How to make a bar chart for sales data in csv file [closed]

I'm trying to make a bar chart of customer sales value by date. I have imported the CSV but I'm stuck on formatting the date. In the file, each date reads like this: 01.08.2023 00:37. Each date has ...
Peter Snee's user avatar
0 votes
3 answers
92 views

datetime and formatting - python

i am trying to print out the current hours mins seconds and milliseconds to a file accurately but cant seem to find the right formatting for the date format log_file.write(datetime.datetime.strptime(f&...
Charlie Parker's user avatar
1 vote
1 answer
107 views

How to format different data types to a dd/mm/yyyy format in Python

I have an code that I want to change all the date column to a format of dd/mm/yyyy. All the values passed in the date column are already in this kind of format, even the second value: 01/02/2001, ...
thi.sampai's user avatar
0 votes
0 answers
25 views

How to format the string values without space to datetime in python? [duplicate]

i have a pandas df: Date 0 20221101 1 20220510 2 20230102 The dates are string and are formatted as %Y%M%D I want to format the entire column to %D%M%Y. Like this: Date 0 01-11-2022 1 10-05-2022 2 02-...
Claudio_TS's user avatar
1 vote
2 answers
499 views

How to convert user input date format to a different format on output in Python

I have a code where the date is an input converted to a date: InvDateStr = input("Enter the invoice date (YYYY-MM-DD): ") InvDate = datetime.datetime.strptime(InvDateStr, "%Y-%m-%d"...
jonahpocalypse's user avatar
0 votes
2 answers
293 views

Fixing Python Bokeh Datetime Import Formatting

I'm exporting datasets from equipment logging software and am trying to use Bokeh (Python) as an interactive visual aide during analysis. Everything is working fine, except for the date/time which ...
MariTort's user avatar
0 votes
3 answers
89 views

What is the correct format code for this type of date?

I have a numpy array (called dates) of dates (as strings) which I thought were in the form %Y-%m-%d %H:%M:%S. However, I get an error that I have dates such as 2021-05-11T00:00:00.0000000. Not sure ...
mathslover's user avatar
1 vote
1 answer
683 views

Plotly - how to format x-axis datetime to a custom format [12AM = 12a]?

I'm trying to change the format of my datetime x-axis ticks to be a specific custom format that matches the rest of my company's formatting. using fig.update_xaxes(tickformat='%-I %p') I can get to a ...
walker967's user avatar
  • 148
0 votes
0 answers
114 views

Python Bokeh MonthsTicker yields strange tick labels

I create figure with dates on the x axis as follows: plot = figure( frame_height=300, x_axis_type="datetime", x_range=( datetime(2018, 9, 1), datetime(2020, 6, 1) ...
Yannic's user avatar
  • 828
0 votes
1 answer
28 views

formatting time written as integers and floats

I'm doing a study on some flight data. it is supposed to be an explanatory analysis where some statistical methods like binning should be used. I'm stuck trying to format Departure and arrival time. ...
Salma Dodin's user avatar
0 votes
0 answers
126 views

Add custom formatting options to python datetime class

I'm trying to add custom formatting options to the python datetime class, specifically a %Q option that will output the quarter. I'm assuming this can be done by extending the datetime class but I'm ...
Josh Jacobson's user avatar
7 votes
1 answer
6k views

Plotting pd df with datetime index in Matplotlib results in ValueError due to wrong parsing of datetime values

I am trying to plot a pandas.DataFrame, but getting an unexplainable ValueError. Here is sample code causing the problem: import pandas as pd import matplotlib.pyplot as plt from io import StringIO ...
C Hecht's user avatar
  • 1,016
0 votes
1 answer
620 views

Date Time Format Issues Python

I am currently having issues with date-time format, particularly converting string input to the correct python datetime format Date/Time Dry_Temp[C] Wet_Temp[C] Solar_Diffuse_Rate[[W/m2]] ...
Loai Alnouri's user avatar
0 votes
1 answer
158 views

Custom datetime formating Python

I want to create custom format date and i'm struggling with that, need help. Is it possible to create datetime format like this "02FEB2021 00:00:00" in Python ?
meteorolog's user avatar

15 30 50 per page
1
2 3 4 5