I've attached a table snippet with the first three and last three timestamp entries.
When I try to format the two sections of the whole thing, the top part looks better but when you click on a cell, it still shows the old version (with the forward slash instead of dash between parts, and AM/PM instead of 24 hour clock) so I don't think excel formatting is actually changing the cell contents. And then the bottom part refuses to do anything on attempts to format it. Nothing changes.
So ok fine let's see if we can open the csv or open as xlsx and save as a csv later?
I had tried to do stuff with pandas but am not exactly sure how to use pd.to_datetime()
and I would need to slice it like "df where timestamp contains "/" then do this" and "df where timestamp not contains "/" then do this": df[df['TIMESTAMP'] ? I can see there is a series.str.contains but that is a series, not a df...
I tried to refresh on openpyxl
Plant_Generation_Data = 'C:/path/to/file'
wb = load_workbook(Plant_Generation_Data)
ws = wb.active
for ea in ws.iter_cols(min_col=1, max_col=1, values_only=True):
#values_only=True means it shows the value, but the generator returns a tuple. so when I try to interact with it, I'm doing it wrong. (but I was thining trying to do a datetime.datetime thing like I think that has a to_datetime somewhere?```
```df['TIMESTAMP'] = df['TIMESTAMP'].astype({'TIMESTAMP': 'datetime64'})```
also I had tried to cast the column as datetime and it looks like the bottom part was successfully turned into the datetime type and the top part is still read...as whatever it is. I need to double check. huh ok yea that is saying it is a datetime.datetime(2020, 1, 6, 1, 30), ok. ...wtf I double checked the type of the bottom section and it is just spitting out the contents ('31-05-2020 23:45', '31-05-2020 23:45') <class 'tuple'>