Python酷库之旅-第三方库Pandas(016)
目录
一、用法精讲
39、pandas.DataFrame.to_stata函数
39-1、语法
39-2、参数
39-3、功能
39-4、返回值
39-5、说明
39-6、用法
39-6-1、数据准备
39-6-2、代码示例
39-6-3、结果输出
40、pandas.read_stata函数
40-1、语法
40-2、参数
40-3、功能
40-4、返回值
40-5、说明
40-6、用法
40-6-1、数据准备
40-6-2、代码示例
40-6-3、结果输出
二、推荐阅读
1、Python筑基之旅
2、Python函数之旅
3、Python算法之旅
4、Python魔法之旅
5、博客个人主页
一、用法精讲
39、pandas.DataFrame.to_stata函数
39-1、语法
# 39、pandas.DataFrame.to_stata函数 DataFrame.to_stata(path, *, convert_dates=None, write_index=True, byteorder=None, time_stamp=None, data_label=None, variable_labels=None, version=114, convert_strl=None, compression='infer', storage_options=None, value_labels=None) Export DataFrame object to Stata dta format. Writes the DataFrame to a Stata dataset file. “dta” files contain a Stata dataset. Parameters: pathstr, path object, or buffer String, path object (implementing os.PathLike[str]), or file-like object implementing a binary write() function. convert_datesdict Dictionary mapping columns containing datetime types to stata internal format to use when writing the dates. Options are ‘tc’, ‘td’, ‘tm’, ‘tw’, ‘th’, ‘tq’, ‘ty’. Column can be either an integer or a name. Datetime columns that do not have a conversion type specified will be converted to ‘tc’. Raises NotImplementedError if a datetime column has timezone information. write_indexbool Write the index to Stata dataset. byteorderstr Can be “>”, “
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。