0

I have a problem combining 2 columns in 1 pandas Dataframe.

My Dataframe data is like:

Nombre Valor Fecha
totalVehiculos 2132.00 2021-09-19 01:12:52
totalVelocidad 81.98 2021-09-19 01:12:52
totalVehiculos 1501.00 2021-09-19 02:07:51
totalVelocidad 84.66 2021-09-19 02:07:51
totalVehiculos 1250.00 2021-09-19 03:02:48
totalVelocidad 86.10 2021-09-19 03:02:48

And I would like to know if it's possible to be:

totalVehiculos totalVelocidad Fecha
2132.00 81.98 2021-09-19 01:12:52
1501.00 84.66 2021-09-19 02:07:51
1250.00 86.10 2021-09-19 03:02:48
Adrian
  • 1
  • https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.pivot.html#pandas.DataFrame.pivot or https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.melt.html – LemonPy Sep 20 '21 at 01:16
  • `df.pivot(index='Fecha', columns='Nombre', values='Valor')` – Henry Ecker Sep 20 '21 at 02:32

0 Answers0