Skip to content

Commit 5b36623

Browse files
committed
minor fixes for issues dipanjanS#5 , dipanjanS#8 and dipanjanS#9
1 parent 00313d8 commit 5b36623

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

notebooks/Ch03_Processing_Wrangling_and_Visualizing_Data/notebook_wrangle_data.ipynb

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"from random import randrange\n",
2626
"from sklearn import preprocessing\n",
2727
"\n",
28+
"from IPython.display import display\n",
29+
"\n",
2830
"pd.options.mode.chained_assignment = None"
2931
]
3032
},
@@ -38,7 +40,9 @@
3840
{
3941
"cell_type": "code",
4042
"execution_count": 2,
41-
"metadata": {},
43+
"metadata": {
44+
"collapsed": true
45+
},
4246
"outputs": [],
4347
"source": [
4448
"def _random_date(start,date_count):\n",
@@ -201,7 +205,9 @@
201205
{
202206
"cell_type": "code",
203207
"execution_count": 3,
204-
"metadata": {},
208+
"metadata": {
209+
"collapsed": true
210+
},
205211
"outputs": [],
206212
"source": [
207213
"df = generate_sample_data(row_count=1000)"
@@ -1864,7 +1870,9 @@
18641870
{
18651871
"cell_type": "code",
18661872
"execution_count": 24,
1867-
"metadata": {},
1873+
"metadata": {
1874+
"collapsed": true
1875+
},
18681876
"outputs": [],
18691877
"source": [
18701878
"df_dropped['price'].fillna(value=np.round(df.price.mean(),decimals=2),\n",
@@ -2811,7 +2819,9 @@
28112819
{
28122820
"cell_type": "code",
28132821
"execution_count": 34,
2814-
"metadata": {},
2822+
"metadata": {
2823+
"collapsed": true
2824+
},
28152825
"outputs": [],
28162826
"source": [
28172827
"df_normalized = df.dropna().copy()\n",
@@ -4095,7 +4105,7 @@
40954105
"name": "python",
40964106
"nbconvert_exporter": "python",
40974107
"pygments_lexer": "ipython3",
4098-
"version": "3.5.4"
4108+
"version": "3.5.3"
40994109
}
41004110
},
41014111
"nbformat": 4,

notebooks/Ch11_Forecasting_Stock_and_Commodity_Prices/lstm_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def get_seq_train_test(time_series, scaling=True,train_size=0.9):
116116
scaler = None
117117
if scaling:
118118
scaler = MinMaxScaler(feature_range=(0, 1))
119+
time_series = np.array(time_series).reshape(-1,1)
119120
scaled_stock_series = scaler.fit_transform(time_series)
120121
else:
121122
scaled_stock_series = time_series

notebooks/Ch11_Forecasting_Stock_and_Commodity_Prices/notebook_gold_forecast_arima.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"from statsmodels.tsa.seasonal import seasonal_decompose\n",
4040
"\n",
4141
"\n",
42-
"from time_series_utils import ad_fuller_test, plot_rolling_stats\n",
43-
"from time_series_utils import plot_acf_pacf, arima_gridsearch_cv"
42+
"from arima_utils import ad_fuller_test, plot_rolling_stats\n",
43+
"from arima_utils import plot_acf_pacf, arima_gridsearch_cv"
4444
]
4545
},
4646
{
@@ -859,7 +859,7 @@
859859
],
860860
"metadata": {
861861
"kernelspec": {
862-
"display_name": "Python [default]",
862+
"display_name": "Python 3",
863863
"language": "python",
864864
"name": "python3"
865865
},
@@ -873,7 +873,7 @@
873873
"name": "python",
874874
"nbconvert_exporter": "python",
875875
"pygments_lexer": "ipython3",
876-
"version": "3.5.2"
876+
"version": "3.5.3"
877877
}
878878
},
879879
"nbformat": 4,

0 commit comments

Comments
 (0)