您可以使用x.dtype获取类型,如下所示:
x.dtype
import tensorflow as tf x=tf.constant([1,2]) x.dtype
这将打印tf.int32
tf.int32
print(df.dtypes)
针对特定列,请使用
print (df['Prices'].dtypes)
参考资料:链接