import
pandas as pd
import
numpy as np
import
matplotlib.pyplot as plt
from
scipy
import
stats as sc
time
=
np.arange(
0
,
10
,
0.1
);
amplitude
=
np.sin(time)
fig, ax
=
plt.subplots(
1
,
2
, figsize
=
(
12
,
7
))
ax[
0
].plot(time, amplitude)
ax[
0
].set_xlabel(
'Time'
)
ax[
0
].set_ylabel(
'Amplitude'
)
ax[
0
].axhline(y
=
0
, color
=
'k'
)
amplitude_series
=
pd.Series(amplitude)
pd.plotting.lag_plot(amplitude_series, lag
=
3
, ax
=
ax[
1
])
plt.show()
sample_size
=
1000
fig, ax
=
plt.subplots(
1
,
2
, figsize
=
(
12
,
7
))
random_series
=
pd.Series(np.random.normal(size
=
sample_size))
random
=
random_series.reset_index(inplace
=
True
)
ax[
0
].plot(random[
'index'
],random[
0
])
pd.plotting.lag_plot(random[
0
],lag
=
1
)
plt.show()
google_stock_data
=
pd.read_csv(
'GOOG.csv'
)
google_stock_data.reset_index(inplace
=
True
)
fig, ax
=
plt.subplots(
1
,
2
, figsize
=
(
12
,
7
))
ax[
0
].plot(google_stock_data[
'Adj Close'
], google_stock_data[
'index'
])
pd.plotting.lag_plot(google_stock_data[
'Adj Close'
], lag
=
1
,ax
=
ax[
1
])
plt.show()
df
=
pd.read_csv(
'Flicker.DAT'
, header
=
None
)
df.reset_index(inplace
=
True
)
fig, ax
=
plt.subplots(
1
,
2
, figsize
=
(
12
,
7
))
ax[
0
].plot(df[
'index'
],df[
0
])
pd.plotting.lag_plot(df[
0
],lag
=
1
,ax
=
ax[
1
])
plt.show()