data normalization in python code example
Example 1: normalize data python
>>> from sklearn import preprocessing
>>>
>>> data = [100, 10, 2, 32, 31, 949]
>>>
>>> preprocessing.normalize([data])
array([[0.10467389, 0.01046739, 0.00209348, 0.03349564, 0.03244891,0.99335519]])
Example 2: data normalization python
from sklearn import preprocessing
normalizer = preprocessing.Normalizer().fit(X_train)
X_train = normalizer.transform(X_train)
X_test = normalizer.transform(X_test)
Example 3: import data from website pandas python medium
import pandas as pd
calls_df, = pd.read_html("https://www.beleggen.nl/koersen/aex.aspx", thousands=".", header=0, match="Royal Dutch Shell A", parse_dates=["Tijd"])
print(calls_df.to_json(orient="records", date_format="iso"))