Skip to content

Instantly share code, notes, and snippets.

@pointonjoel
Last active February 24, 2021 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pointonjoel/5e072c4c9f3048225d5aa0c261db97e4 to your computer and use it in GitHub Desktop.
Save pointonjoel/5e072c4c9f3048225d5aa0c261db97e4 to your computer and use it in GitHub Desktop.
# Example 5
#pip install xlrd # Installing dependancy
import pandas as pd # Importing pandas package
import numpy as np # Importing numpy package
df = pd.read_excel('PAYEMS21.xls', header=10) # Loading data
# Renaming and Indexing
df = df.rename(columns={'observation_date': 'date', 'PAYEMS': 'values'}) # Renaming columns
df.set_index("date",inplace=True) # Setting Index
print(df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment