Date format is stored differently for around 30 pc of the records in dataframe during read operation in R

时光总嘲笑我的痴心妄想 提交于 2019-12-25 01:43:36

问题


I have rbind multiple csv which has multiple columns. One of the columns is date column. However when I view the final dataframe output after rbind, I see that the date format is different for part of the dataframe. I mean if my dataframe has 100 records (for example) last 25 records has different date format. Can you please let me know what can be the issue?

I have already created the final dataframe after rbinding all sheets and found out that, the dateformat is different for around 30% of dataset. When I viewed the source file, it seems to be fine.Can you please help me to fix this?

I am just reading the data from files as it is. I haven't applied any date functions yet. Can you please help me with this?

Scenario - 1

Source file date value

final dataframe value

As you can see below it is only showing '8:57:0' and not '8:57:00'

Scenario 2

Source file date value shown below

As you can see below, it is shown as '18:54' in the cell value but at the top it is '18:54:00". When I double click the cell, it is showing the full value "6:54:00"

final dataframe value

As shown below, shouldn't it be displaying '6:54:00' or "6:54:00'. It only displays what is visible.

How can I make the date display in final dataframe output uniform? Should I make any changes to the source file ("Format cells" in excel).

Can you please help me in identifying the issue and the right scenario (expected output)?

I would like to see the all the date values in the output dataframe to be of the same format.

来源:https://stackoverflow.com/questions/55951785/date-format-is-stored-differently-for-around-30-pc-of-the-records-in-dataframe-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!