I've done so well about importing again,,
I want to use a function called datetime () to start this! It started from that place.
(When I think about it now, this function was a songwriter ...)
import datetime
** Sure! !! ** **
why! !! !! !!
I thought about it.
from datetime import datetime
myDate = datetime(2017,1,1)
You can do this! !!
It seems that there are various patterns, but it seems good to remember the following
** ① import pandas as pd pattern **
This loads the Pandas module and makes it available under the name pd. There are a lot of functions in the Pandas module, like (DataFrame) You can use it by prefixing it with pd in the form of pd.DataFrame ().
** ② from sklearn.linear_model import Logistic Regression pattern **
This is a pinpoint, in a module called sklearn.linear_model, Make it possible to use a function called LogisticRegression. (It seems that there is a concept of submodule, but it is omitted) So you can just use it in the form of Logistic Regression (iroiro)
If you don't use so many different types of functions like scikit-learn, This is probably more suitable. (And vice versa. Pd.hoge)
The following article was insanely detailed. Be careful not to lose track of what you want to know because you are too detailed! https://qiita.com/suzuki-hoge/items/f951d56290617df4279e
By the way, black magic
from pandas import *
There seems to be some. This will allow you to use the functions in the pandas module without a prefix! Convenient! However, it seems that it is better to stop it because the function names collide and something bad happens. I think so.
P.S. The datetime () that got me hooked this time was quite complicated, and it was a pattern that there is a function called datetime in the datetime module.
import datetime
myDate = datetime.datetime(2016,1,1)
import datetime as dt
myDate = dt.datetime(2016,1,1)
This is okay!
Recommended Posts