The following is the code that I am using:
import numpy as np
import pandas as pd
from pandas import DataFrame, Series
animals = DataFrame(np.arange(16).resize(4, 4), columns=['W', 'X', 'Y', 'Z'], index=['Dog', 'Cat', 'Bird', 'Mouse'])
print(animals)
The output I get for this is:
W X Y Z
Dog NaN NaN NaN NaN
Cat NaN NaN NaN NaN
Bird NaN NaN NaN NaN
Mouse NaN NaN NaN NaN
The output that I expect is:
W X Y Z
Dog 0 1 2 3
Cat 4 5 6 7
Bird 8 9 10 11
Mouse 12 13 14 15
However, if I run just:
print(np.arange(16))
the output I get is:
[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]