# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab.research.google.com/github/deathstar1/Machine-Learning-Notebooks/blob/main/TimeSeriesBasics.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + [markdown] id="4ilbEZ6PULGh"
# # Simple Graph

# + id="trG9AO_YTGJs"
import matplotlib.pyplot as plt
import numpy  as np 


# + id="NGIv8xFpU62O"
def plot():
  plt.plot([1, 2, 3], [1, 2, 3], label='line-1')
  plt.plot([1, 2, 3], [3, 2, 1], label='line-2')
  plt.xlabel('Time')
  plt.ylabel('Value')
  plt.legend(fontsize=12)
  plt.grid(True)


# + colab={"base_uri": "https://localhost:8080/", "height": 279} id="GCFibZE_V2DZ" outputId="1f3723ba-db58-45ac-8d0e-772a27c1a18e"
plot()


# + id="TIDxxD6QO2J0"
def plot_series(time,series, format ='-' ,start=0,end=None,label=None):
  plt.plot(time[start:end] ,series[start:end] , label=label )
  plt.xlabel('Time')
  plt.ylabel('Value')
  plt.legend(fontsize=12)


# + id="mvQGW9zmQRUj"
def trend(time, appreciation):
  return time * appreciation



# + colab={"base_uri": "https://localhost:8080/", "height": 296} id="O4Vert3mO2Ga" outputId="b945851c-572a-4a50-c6ce-b69a20f7da20"
time = np.arange(365*4 )
series = trend(time, 0.2)

plot_series(time,series)
plt.show()

StarcoderdataJupyterScriptsDedupFiltered