Dot notation is a shortcut and less reliable than using [' '] notation. If you have a dataframe with a column 'Date Time' then you cannot use df.DateTime.head() you should use df['Date Time'].head() because dot notation will not work if there is column headers with whitespace or special characters.
There are some advantages of using the dot notation, one is in some development environments such as Jupyter notebook.
1. Using the dot notation will help in getting the popup of all available methods that are available and can be used on a dataframe column. This is not available in Jupyter notebook when using [' '] notation.
2. If you are used to programming languages with the dot notation framework then you could have advantage in readability of the code.
3.Use of dot notation can be used where we want quick checks like in jupyter notebooks.
train.Datetime.head()
But when we want to pass variables that may come from other sources, using [] notation is more beneficial.
train['Datetime'].head()
If you want to learn Python for Data Science then you can watch this Python tutorial:
If you want to learn data science in-depth then enroll for best data science training.