Skip to main content

All Questions

Tagged with
1 vote
1 answer
59 views

Python Pandas - Timeseries - Timestamp missing time exact at 00:00

I am trying to read in a csv with a time series of measured values. I have the problem that the time stamp omits the time at 00:00 at the extraction from the measurement system. Here is an excerpt ...
mr_t's user avatar
  • 13
0 votes
1 answer
43 views

Having an issue calculating age using csv file without importing it completely into memory

I keep getting the following error. don't know how to fix it. TypeError: '_csv.reader' object is not subscriptable ..... def median_age(filename): with open(filename, 'r') as file: ...
Lanxin Ma's user avatar
-1 votes
1 answer
84 views

How to add Datetime to my time column in Matlab or Python

I am currently working on constructing my dataset after extracting signals from a (.mat) database in Matlab. [X,Y]=extract_structures(filename); time=X(1).Data; time = Columns 1 through 6 0 ...
achour99's user avatar
-1 votes
1 answer
444 views

ValueError: Invalid isoformat string: 'Operation Date'

New to Python. This probably might be a Python-specific question rather than related to the datetime library. I'm trying to cast a string value, which is in ISO 8601 format, to a date object. However, ...
Arash Koushkebaghi's user avatar
0 votes
0 answers
61 views

How can I save the current date without overwriting it? Pandas Python

I have a .csv database with names. Every month it is updated and I've created a code that breaks down the names that have left and those that have entered the database, generating two .csv's at the ...
Ana Fortes's user avatar
0 votes
1 answer
73 views

How can I add the current date without overwriting yesterday's date? Pandas Python

I'm using pandas to add a 'date' column to my dataframe that returns the value of the current day. I would like my code to record today's date and when my system is triggered again, record the date of ...
Ana Fortes's user avatar
3 votes
2 answers
91 views

Datetime mixes day and month when converting strings to datetime format [closed]

I'm working with a dataset that has a date column in the format dd-mm-yyyy, however this column is an object and I need it to be datetime format in order to extract the month of the date. However, ...
Sara María Cano Martínez's user avatar
0 votes
1 answer
443 views

How can you automatically format dates on the x-axis using matplotlib? [duplicate]

I've been looking all over for a way to evenly space dates using Python 3 with matplotlib, and I haven't been able to find anything that would apply to just having a list of datetime objects. I'm ...
Max's user avatar
  • 39
-1 votes
1 answer
103 views

Is there a way to continuously print a live timestamp to a csv file?

I have this code, which looks for a specific image continously. If it sees the image, I want it to write "Duck" followed by the current datetime into a csv file: now = datetime.datetime.now()...
Matt Buckingham's user avatar
1 vote
1 answer
63 views

Python - Creating multiple slices of data frame based on DATETIME column to export to multiple CSV files

I have a master dataframe that I am trying to slice into multiple smaller dataframes using df.loc and basing those slices off the datetime column as seen below: jan_2021 = merged_df.loc[(merged_df['...
selereth's user avatar
0 votes
1 answer
87 views

PANDAS read_csv: Parse correct Datetime format With "T" string : "2022-01-05T02:24" AND "2022-01-05T02:10:58"

Parse the correct datetime for multiple columns and different formats in the same column Hello community, I have a csv file that I uploaded to jupyter notebook using read_csv from pandas. I am trying ...
candy's user avatar
  • 3
0 votes
0 answers
461 views

Best way to save date and time in csv file

Which way is most optimal to save datetime in csv in python? I have an app which takes measurements once a second and save it to csv files. I use 2 columns: time and date, but python has datetime ...
Paweł Pietraszko's user avatar
1 vote
0 answers
185 views

Why is read_csv so much slower to parse dates than to_datetime

I am using jupyter notebook and reading a .csv file with pandas read_csv. When using the following code, it takes a reeeeeeeally long time (more than 10 minutes). The dataset has 70821 entries. [...
Mrob's user avatar
  • 361
0 votes
1 answer
31 views

How to correctly open txt timeseries files in pandas that has a comma and unseparated date in timestamp?

I have a dataset with txt files that contain timestamps with a comma. The data looks sometime like this TimeStamp, open, high, low, close, volume 20220401,00:00:00,1.31457,1.31468,1.3141,1.31428,141 ...
Kamran's user avatar
  • 1
0 votes
1 answer
181 views

How to sum date time from a CSV

I am trying to add up the time difference from a CSV file and print it in the console. What do I have to do for it? The CSV file looks like this: 16:21,06:15,10:06 22:00,23:00,01:00 20:20,21:00,00:40 ...
red's user avatar
  • 1

15 30 50 per page
1
2 3 4 5
26