'Adding column with dates, hours and minutes + giving existing columns a name
I want to read from an excel with 200 electricity consumption profiles of every quarter of a whole year. So from 01/01/20 00:00:00 till 31/12/20 23:45:00. the first column enumerates from 0-33599 but represents the date. This is my code:
import pandas as pd
import numpy as np
data = pd.read_csv('C:/Users/User/Desktop/Map1.csv', header=None)
print(data)
data('date')=pd.date_range(start='01/01/20 00:00:00', periods=len(data),freq='15T')
[33600 rows x 200 columns]
and an error message: SyntaxError: cannot assign to function call
what can I do to add this date column instead of the numbers 0:33599 and how can I name my columns? like naming column 0 : load profile 1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
