1>>> df2 = pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]),
2... columns=['a', 'b', 'c'])
3>>> df2
4 a b c
50 1 2 3
61 4 5 6
72 7 8 9
8
1import pandas as pd
2
3data = {'First Column Name': ['First value', 'Second value',...],
4 'Second Column Name': ['First value', 'Second value',...],
5 ....
6 }
7
8df = pd.DataFrame (data, columns = ['First Column Name','Second Column Name',...])
9
10print (df)
1>>> df2 = pd.DataFrame(np.array([[23, 99, 78], [65, 95, 90], [90, 98, 96]]),
2... columns=['krish', 'ishwar', 'raj'])
3>>> df2
4 a b c
50 1 2 3
61 4 5 6
72 7 8 9
8
1>>> data = np.array([(1, 2, 3), (4, 5, 6), (7, 8, 9)],
2... dtype=[("a", "i4"), ("b", "i4"), ("c", "i4")])
3>>> df3 = pd.DataFrame(data, columns=['c', 'a'])
4...
5>>> df3
6 c a
70 3 1
81 6 4
92 9 7
10