DataFrame.to_xarray()

DataFrame.to_xarray() [source] Return an xarray object from the pandas object. Returns: a DataArray for a Series a Dataset for a DataFrame a DataArray for higher dims Notes See the xarray docs Examples >>> df = pd.DataFrame({'A' : [1, 1, 2], 'B' : ['foo', 'bar', 'foo'], 'C' : np.arange(4.,7)}) >>> df A B C 0 1 foo 4.0 1 1 bar 5.0 2 2 foo 6.0 >>> df.to_xarray() <xarray.Dataset> Dimensions: (i

DataFrame.to_timestamp()

DataFrame.to_timestamp(freq=None, how='start', axis=0, copy=True) [source] Cast to DatetimeIndex of timestamps, at beginning of period Parameters: freq : string, default frequency of PeriodIndex Desired frequency how : {?s?, ?e?, ?start?, ?end?} Convention for converting period to timestamp; start of period vs. end axis : {0 or ?index?, 1 or ?columns?}, default 0 The axis to convert (the index by default) copy : boolean, default True If false then underlying input data is not copied

DataFrame.transpose()

DataFrame.transpose(*args, **kwargs) [source] Transpose index and columns

DataFrame.to_string()

DataFrame.to_string(buf=None, columns=None, col_space=None, header=True, index=True, na_rep='NaN', formatters=None, float_format=None, sparsify=None, index_names=True, justify=None, line_width=None, max_rows=None, max_cols=None, show_dimensions=False) [source] Render a DataFrame to a console-friendly tabular output. Parameters: buf : StringIO-like, optional buffer to write to columns : sequence, optional the subset of columns to write; default None writes all columns col_space : int, o

DataFrame.to_sql()

DataFrame.to_sql(name, con, flavor=None, schema=None, if_exists='fail', index=True, index_label=None, chunksize=None, dtype=None) [source] Write records stored in a DataFrame to a SQL database. Parameters: name : string Name of SQL table con : SQLAlchemy engine or DBAPI2 connection (legacy mode) Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. flavor : ?sqlite?, default None DEPRECATED: this parameter will be re

DataFrame.to_stata()

DataFrame.to_stata(fname, convert_dates=None, write_index=True, encoding='latin-1', byteorder=None, time_stamp=None, data_label=None, variable_labels=None) [source] A class for writing Stata binary dta files from array-like objects Parameters: fname : str or buffer String path of file-like object convert_dates : dict Dictionary mapping columns containing datetime types to stata internal format to use when wirting the dates. Options are ?tc?, ?td?, ?tm?, ?tw?, ?th?, ?tq?, ?ty?. Column ca

DataFrame.to_sparse()

DataFrame.to_sparse(fill_value=None, kind='block') [source] Convert to SparseDataFrame Parameters: fill_value : float, default NaN kind : {?block?, ?integer?} Returns: y : SparseDataFrame

DataFrame.to_records()

DataFrame.to_records(index=True, convert_datetime64=True) [source] Convert DataFrame to record array. Index will be put in the ?index? field of the record array if requested Parameters: index : boolean, default True Include index in resulting record array, stored in ?index? field convert_datetime64 : boolean, default True Whether to convert the index to datetime.datetime if it is a DatetimeIndex Returns: y : recarray

DataFrame.to_period()

DataFrame.to_period(freq=None, axis=0, copy=True) [source] Convert DataFrame from DatetimeIndex to PeriodIndex with desired frequency (inferred from index if not passed) Parameters: freq : string, default axis : {0 or ?index?, 1 or ?columns?}, default 0 The axis to convert (the index by default) copy : boolean, default True If False then underlying input data is not copied Returns: ts : TimeSeries with PeriodIndex

DataFrame.to_pickle()

DataFrame.to_pickle(path) [source] Pickle (serialize) object to input file path. Parameters: path : string File path