write a program to create a dataframe from a 2d list. specify own index labels
Answers
Answered by
1
Answer:
SORRY I DON'T KNOW ANSWER
Answered by
1
Program to create data frame from 2D list using Python:
import pandas as pd
list1 = [[30,40,50,60],[45,78,58,74],[57,69,85,74],[59,65,48,52]]
df1 = pd.DataFrame(list1, index = ['R1', 'R2', 'R3', 'R4'])
print(df1)
Output:
0 1 2 3
R1 30 40 50 60
R2 45 78 58 74
R3 57 69 85 74
R4 59 65 48 52
Similar questions
Social Sciences,
15 days ago
Chemistry,
15 days ago
Social Sciences,
1 month ago
Math,
1 month ago
History,
9 months ago
Math,
9 months ago