0

I have a dataframe with 5 columns. The Date column is of type Object. df : DATE
0 2020-06-01T00:00:00.000Z
1 2021-08-01T00:00:00.000Z
2 2021-06-01T00:00:00.000Z
3 2021-07-01T00:00:00.000Z
4 2021-01-01T00:00:00.000Z

I am trying to convert the dataframe into xlsb format so that I can use this excel for further analysis.

Why I need to convert it to xlsb format?

I tried removing the TZ component and convert the column into YMD format by following the answer here. The issue I am facing is even after converting, the date column still has timezone component. And when I am performing imputation and outlier treatment in R, it is unable to fetch the year,month,day fields.

Therefore, I am trying to convert the dataframe into xlsb format and then import it, so that the timezone component doesn't occur and I am able to proceed with my imputation/outlier treatment.

If someone has better ways to remove the timezone component from the columns or any other method to transform the datecolumn into YMD format is most welcome.

I have tried searching in stack overflow. But couldn't find the correct answer.

AMIT BISHT
  • 49
  • 1
  • 9
  • Why do you specifically need xlsb, and not xlsx, for example? – BigBen Nov 24 '21 at 13:46
  • @BigBen, I want to perform time series imputation/outlier treatment in R, and before that I am performing some feature engineering in python. But the issue is even if I remove the 'T...Z' component using `d=datetime.fromisoformat(dt[:-1])` and then `d.strftime('%Y-%m-%d')` still the date column has timezone component. And someone asked me to convert and save my dataframe in xlsb and then import it to resolve the date time issue. – AMIT BISHT Nov 26 '21 at 06:54
  • @BigBen I have edited my question for better understanding. – AMIT BISHT Nov 26 '21 at 07:44

0 Answers0