I newest in Pandas,
Please help with the next issue:
- I get the datatable from MS SQL DataBase, like:
(datetime.datetime(2020, 12, 1, 0, 0), 'ECS446_FSL_969_D01_F41', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60', '60'), **...**)
- Input Data in Pandas DataFrame and did next step:
Columns '0'...'59' is a minutes in hour('DataTime') with values of 'TagName'.
Did next transformations:
df1 = pd.DataFrame(result2, columns=['DataTime', 'TagName', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59'])
df1 = df1.pivot(index='TagName', columns= 'DataTime', values=['0', '1', '2', '3', '4', '5', '6', '7', '8', '9','10', '11', '12', '13', '14', '15', '16', '17', '18', '19','20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49','50', '51', '52', '53', '54', '55', '56', '57', '58', '59'])
df1 = df1.T
df1 = df1.sort_values('DataTime')
And have to result:
- The problem is to add minutes to the DateTime column,
I want to get the following result:
question from:
https://stackoverflow.com/questions/65896616/create-new-column-datetime-with-add-minutes-pandas-python