Why converting time to index in pandas dataframe?

  • #1
fog37
1,568
108
Hello,
When dealing with a dataframe with two columns, X and T where T is time, the time column is often converted to be the index of the dataframe itself (which by default is 0,1,2,3,...). What is the advantage of doing that? I know how to implement that but I am not sure what the main benefit is...

Thank you!
 
Computer science news on Phys.org
  • #2
fog37 said:
Hello,
When dealing with a dataframe with two columns, X and T where T is time, the time column is often converted to be the index of the dataframe itself (which by default is 0,1,2,3,...). What is the advantage of doing that? I know how to implement that but I am not sure what the main benefit is...

Thank you!
IF the time step is a constant, ##\delta t##, then the times can be converted into a time step index. That is the way a time series is usually represented. In the usual time series analysis, the magnitude of the time step is not used in the analysis, as long as it is constant.
 
Last edited:
  • Like
Likes fog37

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
568
Replies
3
Views
828
  • Introductory Physics Homework Help
Replies
24
Views
1K
  • Classical Physics
Replies
3
Views
225
  • Set Theory, Logic, Probability, Statistics
Replies
10
Views
1K
  • Special and General Relativity
Replies
1
Views
694
  • Computing and Technology
Replies
14
Views
3K
  • Linear and Abstract Algebra
Replies
2
Views
949
  • Special and General Relativity
5
Replies
146
Views
6K
  • Introductory Physics Homework Help
Replies
5
Views
1K
Back
Top