Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import numpy as np
- # Create empty dataframe
- df = pd.DataFrame()
- # Create a columns
- names = ['Trevor', 'George'] * 18
- counter1 = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10,
- 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18]
- counter2 = np.arange(10, 46)
- # View dataframe
- df["Name"] = names
- df["Counter 1"] = counter1
- df["Counter 2"] = counter2
- df.index += 1
- print(df)
Add Comment
Please, Sign In to add comment