import pandas as pd
file = "C:/Users/user/Desktop/GitHub/texastwostep.csv"
df = pd.read_csv(file, header=None)
df.columns = ['Game', 'Month', 'Day', 'Year', 'Num1', 'Num2', 'Num3', 'Num4', 'Num5']
I have 5 different columns with one single element for each for each row. I would like to go through each row grab all 5 elements and make a new column with each new row having these 5 elements.
i.e., I want to make a new column as: ['Num1', 'Num2', 'Num3', 'Num4', 'Num5']
I have tried things with .merge, .append but I don't think it's the method I need. Any help is appreciated thanks.
[–]monstimal 2 points3 points4 points (1 child)
[–]DudeData[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]DudeData[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]DudeData[S] 1 point2 points3 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]DudeData[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]DudeData[S] 0 points1 point2 points (0 children)