spark.
schema
Returns the underlying Spark schema.
Column names to be used in Spark to represent Koalas’ index. The index name in Koalas is ignored. By default, the index is always lost.
The underlying Spark schema.
Examples
>>> df = ks.DataFrame({'a': list('abc'), ... 'b': list(range(1, 4)), ... 'c': np.arange(3, 6).astype('i1'), ... 'd': np.arange(4.0, 7.0, dtype='float64'), ... 'e': [True, False, True], ... 'f': pd.date_range('20130101', periods=3)}, ... columns=['a', 'b', 'c', 'd', 'e', 'f']) >>> df.spark.schema().simpleString() 'struct<a:string,b:bigint,c:tinyint,d:double,e:boolean,f:timestamp>' >>> df.spark.schema(index_col='index').simpleString() 'struct<index:bigint,a:string,b:bigint,c:tinyint,d:double,e:boolean,f:timestamp>'