Display a Pandas data frame

The following code creates a Pandas data frame containing random values and displays the data frame and its contents.

In [1]:
import pandas as pd
import numpy as np
#Create a data frame containing random numbers
dataFrame = pd.DataFrame(np.random.randn(11,6))
#Display contents of the data frame
dataFrame
Out[1]:
0 1 2 3 4 5
0 -2.266071 0.127243 -0.178797 1.102523 -2.082629 -0.717520
1 0.428442 0.274175 0.751139 0.628268 1.043278 -0.713452
2 0.760993 -0.254896 -0.050506 0.310618 -0.367586 0.124345
3 -0.007717 -2.193680 -0.316330 -0.508507 0.357260 0.787316
4 -0.047781 0.710493 -1.080412 -0.278261 -0.404406 -0.701625
5 -1.088761 0.296324 -1.158283 -0.008756 -1.282784 0.194274
6 -1.228100 -2.175948 -0.332515 -0.243142 -0.248340 -0.314311
7 0.358901 -0.969191 1.583946 -0.637654 0.472644 1.063301
8 -0.509554 3.092229 0.535638 -0.651894 -1.222417 1.088357
9 -0.314287 -0.425290 0.834817 1.003213 0.310173 1.195217
10 -1.322522 -0.537956 -1.432364 -0.828621 -0.024459 -1.473960

Housekeeping material

Author: Prof. Richard G. Baldwin

Affiliation: Professor of Computer Information Technology at Austin Community College in Austin, TX.

File: DisplayPandasDf01.html

Revised: 05/11/18

Copyright 2018 Richard G. Baldwin