#🔒 Converting data in dataframe to minutes and meters

20 messages · Page 1 of 1 (latest)

wary ice
#
data.csv: (journeyTime is ms and length is mm)
roadNo  time    journeyTime length  speed
1544    2024-01-01 00:00:00 1832    34439   18,7986
1582    2024-01-01 00:00:00 1524    28660   18,8058
1585    2024-01-01 00:00:00 1789    33634   18,8004
2063    2024-01-01 00:00:00 1987    38666   19,4595
2064    2024-01-01 00:00:00 1987    38666   19,4595
1544    2024-01-01 00:05:00 1830    34439   18,8191
1582    2024-01-01 00:05:00 1522    28660   18,8305
1585    2024-01-01 00:05:00 1788    33634   18,811
2063    2024-01-01 00:05:00 1984    38666   19,4889
2064    2024-01-01 00:05:00 1987    38666   19,4595
1544    2024-01-01 00:10:00 1833    34439   18,7883
1582    2024-01-01 00:10:00 1523    28660   18,8181
1585    2024-01-01 00:10:00 1789    33634   18,8004
2063    2024-01-01 00:10:00 1987    38666   19,4595
2064    2024-01-01 00:10:00 1989    38666   19,4399

There are 300 different roads in total and I have 288 times of 5 minutes. I want to convert this data into minute and metric formats. For example, the speed at the 400th meter at 01:17. I tried using interpolation and regression to fill empty data but I couldn't

lament pendantBOT
#

@wary ice

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

onyx sleet
#

Well distance will be easy

#

df_name[length_column] = df_name[length_column] * 1000

#

And journey time should be in minutes?

#

So speed would be metres per minute?

#

Wouldn’t km/h be better for speed?

wary ice
#

Sorry for replying late.

#

Lastly, I will draw the heat map of the speed in minutes and meters, but what I am looking for in the first place is to find the speed in the desired minutes and meters (which is not already in the dataframe).

wary ice
onyx sleet
#

Time might be difficult

wary ice
onyx sleet
wary ice
#

Actually, what matters is more meters

#

I want to draw a heat graph of speed in minutes and meters

#

But as you can see, the data is 5 minutes long, I want to convert the data into minutes.

#

I think I should use interpolation for this but I couldn't

lament pendantBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.