Last active
February 14, 2018 12:34
-
-
Save g1039/6141d1edf4c6c5b76fb43cb2cfb6ad96 to your computer and use it in GitHub Desktop.
Learning Pandas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
# Create empty dataframe | |
df = pd.DataFrame() | |
d = pd.date_range('2/1/2016', periods=5) | |
counter = [] | |
for x, y in enumerate(d, 1): | |
counter.append(x) | |
# View dataframe | |
df["Date"] = d | |
df["Counter"] = counter | |
df.index += 1 # start index at 1, not 0 | |
print(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment