If I create a pandas DataFrame using numerical values, this is reflected in the DataFrame. However, if the first element is a string, i.e. 'a', the entire DataFrame goes grey and all numbers in it are converted to strings, i.e. 3 becomes '3'. Why and how to retain datatype diversity?
import numpy as np
import pandas as pd
AA= pd.DataFrame(np.asarray([1,2,3]))
AA2 = pd.DataFrame(np.asarray(['a','b',3]))
The output is
