Add_datepart not in 1.0?

I can’t find the function add_datepart for tabular data in version 1.0 of fastai, am I missing something?

It is not in the library now. You can copy paste it from here : https://github.com/fastai/fastai_docs/blob/master/dev_nb/x_009a_rossman_data_clean.ipynb

3 Likes

thanks a lot!

1 Like

That link is 404’d, anyone have an up to date link? This is a very helpful function.

3 Likes

In case anyone is using fastai 1.0, but still need add_datepart and the rest of the helper methods, you can find them all here (with excellent documentation and examples of usage):

add_datepart is located in fastai.tabular in fastai 1.0.

4 Likes

Direct link for those looking: https://github.com/fastai/fastai/blob/master/fastai/tabular/transform.py :slight_smile:

1 Like

I have imported * from fastai.tabular. because fastai.structured was giving me an error. But I am not able use add_datepart.
I got the error saying

add_datepart is not defined

2 Likes

I was facing the same issue. It seems like the add_datepart is not available in fastai v1.0. You can copy in the source code or use the older version (v0.7)

1 Like

No well, I found a solution. It is in the fastai.tabular library itself.
Try importing,

from fastai.tabular.all import *
This shall work :slight_smile:

2 Likes

thank you so much!

1 Like