首页 > 其他分享 >stata sfi.Data举例

stata sfi.Data举例

时间:2023-04-24 16:00:49浏览次数:27  
标签:end python 19 stata sfi Data dataraw

sysuse auto
python
from sfi import Data
dataraw = Data.get('foreign')
dataraw
end
// . python
// ----------------------------------------------- python (type end to exit) --------------------------------------------------------------------------------------------------------------------------------------------------------------------
// >>> from sfi import Data
// >>> dataraw = Data.get('foreign')
// >>> dataraw
// [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
// >>> end
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

python
from sfi import Data
dataraw = Data.get('foreign mpg rep78',range(46,56))
dataraw
end

// . python
// ----------------------------------------------- python (type end to exit) --------------------------------------------------------------------------------------------------------------------------------------------------------------------
// >>> from sfi import Data
// >>> dataraw = Data.get('foreign mpg rep78',range(46,56))
// >>> dataraw
// [[0, 18, 4], [0, 18, 1], [0, 19, 3], [0, 19, 3], [0, 19, 8.98846567431158e+307], [0, 24, 2], [1, 17, 5], [1, 23, 3], [1, 25, 4], [1, 23, 4]]
// >>> end
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



generate touse = mpg<20
python
from sfi import Data
dataraw = Data.get('foreign mpg rep78',range(46,56),"touse")
dataraw
end

//
// . python
// ----------------------------------------------- python (type end to exit) --------------------------------------------------------------------------------------------------------------------------------------------------------------------
// >>> from sfi import Data
// >>> dataraw = Data.get('foreign mpg rep78',range(46,56),"touse")
// >>> dataraw
// [[0, 18, 4], [0, 18, 1], [0, 19, 3], [0, 19, 3], [0, 19, 8.98846567431158e+307], [1, 17, 5]]
// >>> end
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//



python
from sfi import Data
dataraw = Data.get('foreign mpg rep78',range(46,56),"touse",valuelabel=True)
dataraw
end

//
// . python
// ----------------------------------------------- python (type end to exit) --------------------------------------------------------------------------------------------------------------------------------------------------------------------
// >>> from sfi import Data
// >>> dataraw = Data.get('foreign mpg rep78',range(46,56),"touse",valuelabel=True)
// >>> dataraw
// [['Domestic', 18, 4], ['Domestic', 18, 1], ['Domestic', 19, 3], ['Domestic', 19, 3], ['Domestic', 19, 8.98846567431158e+307], ['Foreign', 17, 5]]
// >>> end

 

标签:end,python,19,stata,sfi,Data,dataraw
From: https://www.cnblogs.com/xkdn/p/17349771.html

相关文章

  • 获取DataRow[]的值
    https://blog.csdn.net/yuanzhugen/article/details/22810817首先,DataRow[]dr=dt.Select(“t1=‘a’”);得出的结果是一个数组,你只要循环这个数组就好了。stringx="";if(dr.Length>0){foreach(DataRowdrNindr){x+=drN["t2"];//循环获得过滤条......
  • python stata 交互
    pythonfromsfiimportDatafromsfiimportDatetimefromsfiimportFramefromsfiimportMacrofromsfiimportValueLabelcca="北京"ac=cca.split('')foriiinac:Macro.setLocal('x',ii)enddisp"`x'"py......
  • scn增量备份恢复dataguard从库(出现gap后主库有添加新的数据文件)
    环境:OS:Centos7DB:19.3.0.0 1.正常同步情况下的scn主从是一致的主库查询:SQL>selectSEQUENCE#,FIRST_CHANGE#,NEXT_CHANGE#,APPLIED,STATUSfromv$archived_logtwherename='tnsslavea';SEQUENCE#FIRST_CHANGE#NEXT_CHANGE#APPLIEDSTATUS-----------------......
  • 7 Best Practice Tips for PostgreSQL Bulk Data Loading
    7BestPracticeTipsforPostgreSQLBulkDataLoading  February19,2023Sometimes,PostgreSQLdatabasesneedtoimportlargequantitiesofdatainasingleoraminimalnumberofsteps.Thisiscommonlyknownasbulkdataimportwherethedatas......
  • java调用GDAL,接口运行一次出现A fatal error has been detected by the Java Runtime
    参考文章:https://www.jianshu.com/p/4bffe29e3a02问题描述:通过调用GDAL写的SpringBoot接口,第一次访问成功,第二次报错,显示报错的位置为gdal库。尝试了很多方法https://www.cnblogs.com/jokingremarks/p/15132599.html#!comments仍然不成功,感觉应该是第二次运行接口时,进行垃圾回......
  • Mybatis中的<![CDATA[]]>标签在判断日期场景中的使用
    背景在使用mybatis时我们sql是写在xml映射文件中,如果写的sql中有一些特殊的字符的话,在解析xml文件的时候会被转义。如大于号>会被转义为>转义后的可读性不是很直观,如果想让其看起来更加直观可读性更强的话,则需要使用<![CDATA[]]>来圈起来不被转义的符号以此来解决这个问题。......
  • DataX-阿里开源离线同步工具在Windows上实现Sqlserver到Mysql全量同步和增量同步
    场景Kettle-开源的ETL工具集-实现SqlServer到Mysql表的数据同步并部署在Windows服务器上:https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/119891674上面讲过Kettle的使用,下面记录下阿里开源异构数据源同步工具DataXDataXDataX是一个异构数据源离线同步工具,致力......
  • dataCompare核心功能之数据探针
    1数据探针产生的背景在数据开发和接入的过程中,数据开发人员接到一个需求或者一条新的业务线可能需要搭建数仓,做数据处理,然后提供一些指标数据给到需求方,如果是你这边会怎么开始呢?直接开干?抽表,清洗,分层,建模?然后发现做完之后,怎么数据各种不对,取不到想要的数据,比如说:业务上说明明一个......
  • Livedata+viewmodel+Fragment
    title:LiveDataviewmodel实现Fragment间的通信使用ViewModel+LiveData实现同一个Activity不同Fragment间的通信。1.将两个Fragment等比例放置在Activity的布局文件中。<?xmlversion="1.0"encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayoutxmlns:an......
  • data
    1、sota取三元组:从常识性知识图谱中取去三元组:(head=事件1,relation=事件的关系,tail=事件2),比如Head:PersonXgoestoanamusementpark,Relation:xIntent,Tail:havefunridingattractions.三元组转成句子:符号替换,比如PersonX替换成人名:PersonXgoestoanamusementpark,......