03 2023 档案

摘要:fitz模块打开PDF文件报错:RuntimeError(f“Directory '{directory}' does not exist”)RuntimeError: Directory 'static/' does not exist from import fitz解决方案:删除fitzpip 阅读全文
posted @ 2023-03-31 15:56 myrj 阅读(1365) 评论(0) 推荐(0)
摘要:#include <stdio.h> main() { char c; c=0345; printf("%d\n",c); } 16进制:每个16进制转成4位2进制,分组计算 8进制345: 转2进制,每个8进制转成3位2进制 2进制:011 100 101 229: 128 64 32 16 8 阅读全文
posted @ 2023-03-31 11:01 myrj 阅读(74) 评论(0) 推荐(0)
摘要:import ospath="d:\\python37" filetype=".pdf" #遍历包括子文件夹 def get_filename(path,filetype): filetype1=filetype.upper() #print(filetype) name =[] final_nam 阅读全文
posted @ 2023-03-31 10:02 myrj 阅读(360) 评论(0) 推荐(0)
摘要:#include <stdio.h> //从C语言语法角度'\48',转义的8进制,48是不合法的8进制数,所以此转义非法 //有警告被理解为宽字符,理解为2个字符,4被转义,8不能被转义只能是字符8,分别是ASCII为4 和56,分别转为16进制:0438=8*16^0+3*16^1+4*16^2 阅读全文
posted @ 2023-03-30 09:21 myrj 阅读(80) 评论(0) 推荐(0)
摘要:from selenium import webdriver import os import time import json def browser_initial(): """" 进行浏览器初始化 """ os.chdir('D:\\') browser = webdriver.Chrome( 阅读全文
posted @ 2023-03-29 09:07 myrj 阅读(624) 评论(0) 推荐(0)
摘要:先将指定位置设定为当前目录 import os os.chdir('E:\qi') with open("1.txt", "w") as f: f.write(jsonCookies) 阅读全文
posted @ 2023-03-29 09:03 myrj 阅读(102) 评论(0) 推荐(0)
摘要:1+X证书 标准要求 阅读全文
posted @ 2023-03-28 19:56 myrj 阅读(27) 评论(0) 推荐(0)
摘要:OrbStack 是 Docker Desktop 的直接替代品,它更快、更轻、更简单且更易于使用。官网orbstack.dev 。目前免费(测试期内),但将来可能会收费 ​​​ 阅读全文
posted @ 2023-03-28 16:16 myrj 阅读(1084) 评论(0) 推荐(0)
摘要:1.“文明实践" 参加活动 按钮 找到相应活动,申请参数,然后扫码签到 或: 首页 向下滑动 找到志愿服务 参加活动 按钮 找到相应活动,申请参数,然后扫码签到 阅读全文
posted @ 2023-03-28 11:57 myrj 阅读(20) 评论(0) 推荐(0)
摘要:pandas 保存.dta文件时报错: UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-2: ordinal not in range(256) import pandas as pd df = pd 阅读全文
posted @ 2023-03-27 10:34 myrj 阅读(481) 评论(0) 推荐(0)
摘要:GCC编译C源程序时出现:错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token,通常是因为在函数声明(包括包含的头文件中的函数声明)后面忘记了分号“;”。仔细检查一遍各个函数声明,把遗漏的分号“;”加上去就可以解决此 阅读全文
posted @ 2023-03-27 10:10 myrj 阅读(5004) 评论(0) 推荐(0)
摘要:#include <windows.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <conio.h> #include <stdbool.h> /* ¹ÜµÀ¾ä±úµÄ¶¨Òå */ HANDLE hStd 阅读全文
posted @ 2023-03-26 17:42 myrj 阅读(99) 评论(0) 推荐(0)
摘要:df.columns.tolist() ['pid', 'fid18', 'age', 'pidhaizi', 'pidhaizia', 'pidhaizib', 'pidhaizic', 'pidhaizid', 'pidhaizie', 'pidhaizif', 'pidhaizig', 'mi 阅读全文
posted @ 2023-03-26 15:21 myrj 阅读(135) 评论(0) 推荐(0)
摘要:import numpy as np iux=np.nan_to_num(row[ii],nan=99999)#判断如果是缺失值,则改为99999 阅读全文
posted @ 2023-03-26 08:30 myrj 阅读(115) 评论(0) 推荐(0)
摘要://检测缺失值方法: //用.表示缺失值,将缺失值定义为无穷大 //方法一:检测当前行有几个变量是缺失值,Stata执行描述性统计命令时,会自动忽略变量的缺失值;执行回归命令时,如果其中某个变量包含缺失值,Stata忽略这个变量所属观测值上所有变量取值 egen miss=rowmiss(_all) 阅读全文
posted @ 2023-03-26 07:08 myrj 阅读(2731) 评论(0) 推荐(0)
摘要:STATA .do文件中命令特别长: .do文件中如果一条命令字符特别多,可在第一行末尾///(三个斜杠)表示此命令持续到下一行,该命令只有在达到不以///结尾的那一行之后才会执行 ​​​ 长命令另一处理方式:使用#delimit;命令,设定一个英文分号作为一行命令结束的分隔符。接着键入一条直到分号 阅读全文
posted @ 2023-03-25 21:50 myrj 阅读(2349) 评论(0) 推荐(0)
摘要:STATA which命令: which命令: which 命令名称 显示"命令名称"是内在的命令还是由某个ado文件 定义的命令 显示命令regress是由特定位置的regress.ado文件来完成,更新时间:2020 12 9 which regress // D:\Stata17\ado\ba 阅读全文
posted @ 2023-03-25 21:48 myrj 阅读(91) 评论(0) 推荐(0)
摘要:STATA 代码段驻留内存,方便调用 program counta use ceshi1,clear #delimit ; merge 1:1 id using ceshi2,update replace ; #delimit cr list end //运行上述代码后,则以后可输入counta来代 阅读全文
posted @ 2023-03-25 21:47 myrj 阅读(73) 评论(0) 推荐(0)
摘要:use ceshi1,clear list // // + + // | id ks2019 ks2020 ks2021 ks2022 ks2023 ab | // | | // 1. | 1 1 0 1 2 0 1 | // 2. | 2 2 0 2 3 2 . | // 3. | 3 3 0 3 阅读全文
posted @ 2023-03-25 19:25 myrj 阅读(946) 评论(0) 推荐(0)
摘要:if re.match('\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}', str(lba[1])): print(1) 阅读全文
posted @ 2023-03-25 08:32 myrj 阅读(326) 评论(0) 推荐(0)
摘要:import warnings warnings.filterwarnings("ignore") 阅读全文
posted @ 2023-03-25 07:04 myrj 阅读(59) 评论(0) 推荐(0)
摘要:# 1. 构造Timestamp # ts_input参数支持4种格式,datetime-like, str, int, float # 1.1 datetime-like import datetime import pandas as pd time_str = "2020-08-01 10:2 阅读全文
posted @ 2023-03-24 19:19 myrj 阅读(97) 评论(0) 推荐(0)
摘要:C语言是一种 语言。 A . 编译型B . 解释型C . 编译、解释混合型D . 脚本 参考答案: A ● 参考解析 编译型语言指用该语言编写的程序在执行前,需要由相应的编译器将源程序翻译为目标代码程序,然后在目标机器上运行目标代码程序。解释型语言指用该语言编写的程序无需编译为目标代码,即可执行。对 阅读全文
posted @ 2023-03-23 20:49 myrj 阅读(490) 评论(0) 推荐(0)
摘要:import os from pdf2image import convert_from_path from PIL import Image def nerge_inages(inages): images = [Image.open(x) for x in images] vidths, hei 阅读全文
posted @ 2023-03-23 18:13 myrj 阅读(266) 评论(0) 推荐(0)
摘要:import pyreadstat as pyreadstat dataframe, meta = pyreadstat.read_dta("1.dta") #stata变量标签: print(meta.column_labels) #stata变量名: print(meta.column_name 阅读全文
posted @ 2023-03-23 15:52 myrj 阅读(208) 评论(0) 推荐(0)
摘要://手工输入数据保存为mb1.dta input id ks2020 ks2021 ks2022 ks2023 1 1 2 3 4 2 4 1 3 2 3 7 0 3 0 4 10 -1 3 -2 5 13 -2 3 -4 6 16 -3 3 -6 7 19 -4 3 -8 8 22 -5 3 -1 阅读全文
posted @ 2023-03-23 14:20 myrj 阅读(544) 评论(0) 推荐(0)
摘要:Bloop 的主要功能如下:- 基于 GPT-4 的会话搜索;- 快速的正则表达式搜索;- 同步本地和 GitHub 仓库;- 支持多种不同查询方式的过滤器;- 使用符号搜索查找函数、变量或特征- 拥有 10 多种编程流行语言的精确代码导航。GitHub:github.com/BloopAI/blo 阅读全文
posted @ 2023-03-23 14:05 myrj 阅读(410) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # coding: utf-8 # @author: sSWans # @file: main.py # @time: 2018/1/11 15:54 import os import random from _datetime import dateti 阅读全文
posted @ 2023-03-23 12:37 myrj 阅读(61) 评论(0) 推荐(0)
摘要:import cv2 import numpy as np def OnMouseAction(event,x,y,flags,param): # 鼠标触发记录点位 global coor_x, coor_y, coor if event == cv2.EVENT_LBUTTONDOWN: prin 阅读全文
posted @ 2023-03-23 10:20 myrj 阅读(84) 评论(0) 推荐(0)
摘要:import cv2 #取得指定图像或视频鼠标位置的颜色特征 from pylab import * from PIL import Image import sys import copy user_input = int(input("如果标视频,请输入1 ;如果标图片,请输入2: ")) if 阅读全文
posted @ 2023-03-23 10:07 myrj 阅读(148) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # coding: utf-8 # @author: sSWans # @file: main.py # @time: 2018/1/11 15:54 import os import random from _datetime import dateti 阅读全文
posted @ 2023-03-22 13:37 myrj 阅读(79) 评论(0) 推荐(0)
摘要:#!/usr/bin/python3.6 # -*- coding: utf-8 -*- ''' @ Copyright (C) 2019 @ @ env stetup:pip3 install opencv-python @ @ 免费知识星球:[一番码客-积累交流](https://t.zsxq. 阅读全文
posted @ 2023-03-22 12:57 myrj 阅读(180) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <string.h> void reverse(char *str) { int len = strlen(str),i; char temp; for (i = 0; i < len / 2; i++) { temp = str[i]; st 阅读全文
posted @ 2023-03-22 09:32 myrj 阅读(50) 评论(0) 推荐(0)
摘要:#include<stdio.h> // 求e=1/1!+1/2!+1/3!+....+1/n! main() { double e=1,a,s=1; int i; for(i=1;i<=20;i++) { s*=i; a=1/s; e+=a; } printf("%f",e); } 阅读全文
posted @ 2023-03-22 08:56 myrj 阅读(166) 评论(0) 推荐(0)
摘要:#include <stdio.h> //从键盘输入一个字符串,将字符串中出现的所有大写字母循环右移5位 【1】 main() { char s[30]; int i=0,n; 【1】; n=strlen(s); while(【1】) { if(【1】) s[i]=s[i]+5; if(【1】) 【 阅读全文
posted @ 2023-03-22 08:49 myrj 阅读(127) 评论(0) 推荐(0)
摘要:首先在python里检查,也是大家用的最多的方式,检查GPU是否可用(但实际并不一定真的在用) import torch torch.cuda.is_available() False(显示结果:不可用) True(显示结果:可用) import torch # setting device on 阅读全文
posted @ 2023-03-22 08:19 myrj 阅读(3071) 评论(0) 推荐(0)
摘要:1. && 左边表达式为0,则最后结果为0,右边的表达式不用计算 2. | 左边表达式为1,则最后结果为1,右边的表达式不用计算 3. unsigned 无符号整型 4. int a=4; //二进制: 原码 反码 补码:00000000 00000000 0000000000000100 int 阅读全文
posted @ 2023-03-22 06:46 myrj 阅读(105) 评论(0) 推荐(0)
摘要:Codon是一个高性能的Python编译器,可以将Python代码编译成本地机器代码,没有任何运行时开销。与Python相比,单线程的典型加速比在10-100倍以上。Codon的性能通常与C / C ++相当(有时甚至更好)。与Python不同,Codon支持本地多线程,这可能导致速度提高多倍。Co 阅读全文
posted @ 2023-03-21 22:04 myrj 阅读(628) 评论(0) 推荐(0)
摘要:#include <stdio.h> main() { char a[]="hellofg",*p=a; printf("%c\n",*p+5) ;//*p得到指针指的字符,+5是字符ASCII码加5 ,结果为m printf("%c\n",*(p+5)) ;//h:p+0 e:p+1....f:p 阅读全文
posted @ 2023-03-21 09:33 myrj 阅读(88) 评论(0) 推荐(0)
摘要:from rembg import remove from PIL import Image input_path="tuurenwu.png" out="mca.png" input=Image.open(input_path) outa=remove(input) outa.save(out) 阅读全文
posted @ 2023-03-21 07:15 myrj 阅读(126) 评论(0) 推荐(0)
摘要:选择英文,按shift+F3 阅读全文
posted @ 2023-03-20 21:03 myrj 阅读(167) 评论(0) 推荐(0)
摘要:电脑没联网,有不认识的字:利用WORD的拼音指南 阅读全文
posted @ 2023-03-20 21:00 myrj 阅读(93) 评论(0) 推荐(0)
摘要:Microsoft Visual C++ Redistributable 阅读全文
posted @ 2023-03-20 20:50 myrj 阅读(134) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-03-20 20:44 myrj 阅读(16) 评论(0) 推荐(0)
摘要:Python 数据库名为 dataset,将关系型数据库包装为 NoSQL 使用方式,非常方便快捷。底层基于 SQLAlchemy,因此支持多种数据库 SQLite、PostgreSQL、MySQL。dataset.readthedocs.io/en/latest/ ​​​ 阅读全文
posted @ 2023-03-20 20:37 myrj 阅读(48) 评论(0) 推荐(0)
摘要:https://modelscope.cn/models/damo/text-to-video-synthesis/summary?continueFlag=316e474d46439886c7d26c850c8c9d37 from modelscope.pipelines import pipel 阅读全文
posted @ 2023-03-20 13:35 myrj 阅读(220) 评论(0) 推荐(0)
摘要:aak="adb -s {0} shell am start --user 0 -n com.kuaishou.nebula/com.yxcorp.gifshow.HomeActivity".format(sjh) aak="adb -s {0} shell am start --user 999 阅读全文
posted @ 2023-03-20 08:23 myrj 阅读(348) 评论(0) 推荐(0)
摘要:>>> jiance(sjh) ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities) Display #0 (activities from top to bottom): Stack #190: type=standard mode=f 阅读全文
posted @ 2023-03-20 07:31 myrj 阅读(91) 评论(0) 推荐(0)
摘要:import pandas as pd from sqlalchemy import create_engine # read in the Statal file df = pd.read_stata('1.dta') # create a connection to the MySQL data 阅读全文
posted @ 2023-03-19 20:56 myrj 阅读(58) 评论(0) 推荐(0)
摘要:. export excel using "D:\statashu\221.xls", firstrow(variables) nolabel //将当前表导出为xls,第一行作为标题,没有值标签 //导入xls,第一行作为变量名 import excel "D:\statashu\221.xls" 阅读全文
posted @ 2023-03-19 20:48 myrj 阅读(695) 评论(0) 推荐(0)
摘要:下载https://github.com/mli/autocut 解压缩:pip install git+https://github.com/mli/autocut.git D:\c-理论\tool\autocut-main\autocut-main> python setup.py instal 阅读全文
posted @ 2023-03-19 20:26 myrj 阅读(186) 评论(0) 推荐(0)
摘要:import pandas as pd df=pd.read_excel('bb.xlsx') column = list(df.columns) for i in range(0, len(df)): print(df.iloc[i][column[0]],df.iloc[i][column[1] 阅读全文
posted @ 2023-03-19 14:57 myrj 阅读(923) 评论(0) 推荐(0)
摘要:import pandas as pd file=pd.read_excel('bb.xlsx') column = list(file.columns) for i in range(len(file)): x = [file.iloc[i][x] for x in range(len(colum 阅读全文
posted @ 2023-03-19 14:45 myrj 阅读(177) 评论(0) 推荐(0)
摘要:import pdfplumber import pandas as pd from PIL import Image pdf = pdfplumber.open("xue1.pdf") #Load page_0 p0 = pdf.pages[0] table = p0.extract_table( 阅读全文
posted @ 2023-03-19 12:13 myrj 阅读(34) 评论(0) 推荐(0)
摘要:* 加载一个Stata数据集 sysuse auto * 在Stata中执行Python代码 python: import pandas as pd import pymysql import stata_setup stata_setup.config("c:\python37\python.ex 阅读全文
posted @ 2023-03-19 07:27 myrj 阅读(73) 评论(0) 推荐(0)
摘要://stata调用python,引用py文件中的函数 //stata中设置python路径 set python_exec d:\python37\python.exe //stata中调用python python //引入函数 from myfunction1 import add_number 阅读全文
posted @ 2023-03-18 10:35 myrj 阅读(295) 评论(0) 推荐(0)
摘要:MD5是一种不可逆的哈希算法,这意味着您不能直接从MD5哈希值“解密”出原始数据。然而,您可以尝试使用暴力破解或查找表(如彩虹表)来猜测原始数据。 暴力破解是一种尝试所有可能的输入组合,直到找到与给定哈希值匹配的输入的方法。这种方法在密码空间较小的情况下可能有效,但在密码空间较大的情况下可能非常耗时 阅读全文
posted @ 2023-03-17 18:27 myrj 阅读(3269) 评论(0) 推荐(0)
摘要:import hashlib def sha256_encrypt(data): sha256 = hashlib.sha256() sha256.update(data.encode('utf-8')) return sha256.hexdigest() data = "Hello, world! 阅读全文
posted @ 2023-03-16 22:17 myrj 阅读(216) 评论(0) 推荐(0)
摘要:webuse dollhill2, clear gen n = _n gen N = _N 如果想要统计各个不同的年龄段中共多少人吸烟: by age (smokes), sort: generate wgta=pyears[_N] . by age (smokes), sort: generate 阅读全文
posted @ 2023-03-15 15:51 myrj 阅读(232) 评论(0) 推荐(0)
摘要:clear input ID year var1 var2 var3 1 2006 34 45 65 1 2007 45 43 41 1 2007 3 56 59 1 2008 39 54 76 1 2009 41 57 68 end save "data00.dta", replace use " 阅读全文
posted @ 2023-03-15 10:14 myrj 阅读(161) 评论(0) 推荐(0)
摘要:stata 统计每行各个变量共有几个是缺失值: //增加新变量miss,统计当前行观测值有几个缺失值 egen miss=rowmiss(_all) ​​​ 阅读全文
posted @ 2023-03-15 08:08 myrj 阅读(480) 评论(0) 推荐(0)
摘要:webuse hbp2, clear //不显示值标签,只显示实际保存值 tab race ,nolabel // // Race | Freq. Percent Cum. // + // 1 | 196 17.41 17.41 // 2 | 773 68.65 86.06 // 3 | 157 1 阅读全文
posted @ 2023-03-15 05:56 myrj 阅读(1600) 评论(0) 推荐(0)
摘要:#include <stdio.h> main() { float a=-3.14153265; printf("%8.4f\n",a) ; printf("%7.4f\n",a) ; printf("%6.4f\n",a) ; printf("%5.4f\n",a) ; printf("%4.4f 阅读全文
posted @ 2023-03-14 20:41 myrj 阅读(703) 评论(0) 推荐(0)
摘要:#include <stdio.h> //整数赋值给字符型变量 //353转2进制:1 01100001 =256 64 32 1 353-256=97 main() { int n=353; char c; c=n; printf("%c %d %x",c,c,c); getchar(); } 阅读全文
posted @ 2023-03-13 21:43 myrj 阅读(245) 评论(0) 推荐(0)
摘要:. bysort rep78: gen ab=_n . order ab,after(rep78) . bysort rep78: gen abb=sum(rep78) . order abb,after(rep78) 阅读全文
posted @ 2023-03-13 20:59 myrj 阅读(635) 评论(0) 推荐(0)
摘要://1.显示stata的系统路径 . sysdir STATA: D:\Stata17\ //stata软件的安装位置 BASE: D:\Stata17\ado\base\ //stata官方的命令及说明帮助文件 SITE: D:\Stata17\ado\site\ PLUS: C:\Users\z 阅读全文
posted @ 2023-03-13 10:57 myrj 阅读(2893) 评论(1) 推荐(0)
摘要:问题描述: 用能启动的光盘安装GHOST WINXP,安装正常,但启动时拿出光盘则不能启动,插入光盘选择从H 从硬盘启动,可正常。将启动顺序改为直接从硬盘启动则提示: Reboot and Select proper Boot deviceor Insert Boot Media in select 阅读全文
posted @ 2023-03-12 05:20 myrj 阅读(988) 评论(0) 推荐(0)
摘要:use cfps2014adult_201906, clear label list brow if fid10 8 // inlist(z,a,b,.….)语法描述:当z满足a,b,….中的任何一个,则返回值为1,否则为0。所有参数必须是实数或者字符型数据, // 其中数值型参数的个数需要在2~2 阅读全文
posted @ 2023-03-10 06:02 myrj 阅读(439) 评论(0) 推荐(0)
摘要:https://www.lianxh.cn/news/2916ae8363459.html https://www.xiaohongshu.com/explore/62fc6f8c00000000140361fa use cfps2018famecon_202101,clear keep fid18 阅读全文
posted @ 2023-03-09 21:02 myrj 阅读(162) 评论(0) 推荐(0)
摘要:>>> attr={"class":"avdata card","data-hash-id":"data-hash-id"} >>> attr.keys() dict_keys(['class', 'data-hash-id']) >>> list(attr.keys()) ['class', 'd 阅读全文
posted @ 2023-03-09 16:43 myrj 阅读(65) 评论(0) 推荐(0)
摘要:.edit //编辑查看当前数据 右击任意一数据,选择"数据"--"值标签"--可选择:从值标签赋值 附加值标签给变量 隐藏所有值标签等相关操作 //从值标签赋值:将13条观测值的tb1m_a_c9 利用值标签修改为-2 . replace tb1m_a_c9 = -2 in 13 . replac 阅读全文
posted @ 2023-03-08 14:45 myrj 阅读(1646) 评论(0) 推荐(0)
摘要://字母小写转大写 . disp strupper("mybook") MYBOOK . disp strupper("da") DA //字母大写转小写 . disp strlower("ASDF") asdf //每个单词首字母大写 . disp strproper("this is a boo 阅读全文
posted @ 2023-03-08 10:36 myrj 阅读(739) 评论(0) 推荐(0)
摘要://stritrim(s1)将s1中的多个连续空格缩减为一个空格 . disp stritrim("good 123") good 123 //strltrim(s1)将s1中左侧的空格删除 . disp strltrim(" good 123") good 123 //strltrim(s1)将s 阅读全文
posted @ 2023-03-08 10:18 myrj 阅读(1517) 评论(0) 推荐(0)
摘要:*split字符分隔 *1,2,3 -- > 1 2 3 clear //清内存 set obs 5 //设置5个样本 gen v1 = "1 2 3" //建立新变量,v1,其值都是"1 2 3" split v1,gen(a) //分隔v1,建立以a开头后面是分隔字符的变量名,空格是默认分隔符 阅读全文
posted @ 2023-03-08 08:11 myrj 阅读(373) 评论(0) 推荐(0)
摘要://清除内存 clear //设置5个样本 set obs 5 //增加变量v1,都是this is the day gen v1 = "this is the my is day" //增加新变量,v1_replace,其值是替换v1中的第一个is为X gen v1_replace = subin 阅读全文
posted @ 2023-03-08 07:56 myrj 阅读(499) 评论(0) 推荐(0)
摘要:local sj=subinstr(subinstr("`c(current_time)'",":","",.)," ","",.) local wjma="`sj'" set seed `wjma' clear local shu= int(100*runiform() ) // local xm 阅读全文
posted @ 2023-03-08 07:46 myrj 阅读(63) 评论(0) 推荐(0)
摘要:local sj=subinstr(subinstr("`c(current_time)'",":","",.)," ","",.) local wjma="`sj'" set seed `wjma' clear local shu= int(100*runiform() ) // local xm 阅读全文
posted @ 2023-03-07 21:06 myrj 阅读(71) 评论(0) 推荐(0)
摘要:// plural(n,s) // // 用法:为字符串加s变为复数,当n的取值不是+/-1时,就在s后添加后缀"s";当n的取值是+/-1时,就在s后不加后缀"s" //n为1,不加s . disp plural(1,"banana") banana //n为2,加s . disp plural( 阅读全文
posted @ 2023-03-07 20:59 myrj 阅读(139) 评论(0) 推荐(0)
摘要:indexnot函数分析与详例解析 //indexnot(s1,s2)以单个字符判断为依据,结果是在s1中的位置表示; //indexnot(s1,s2) 返回s1中第一个在s2中找不到的字母的位置,若s1所有的字母在s2中均可以找到,则返回0 //字符a在第二个串中包含,而b不包含,b的位置是2, 阅读全文
posted @ 2023-03-07 20:03 myrj 阅读(267) 评论(0) 推荐(0)
摘要:Python 调用 js 文件,报 execjs._exceptions.ProgramError: SyntaxError: 缺少 ';' 错误 原因:execjs 默认使用了windows的JScript 引擎导致的,我们可以在python命令行中查看 import execjs execjs. 阅读全文
posted @ 2023-03-07 09:21 myrj 阅读(7620) 评论(0) 推荐(1)
摘要:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyexecjs import execjs 阅读全文
posted @ 2023-03-07 06:55 myrj 阅读(74) 评论(0) 推荐(0)
摘要:1.打开闲鱼,设置 2.“全局自动回复设置” 3.设置相应的信息 4.“开启所有宝贝自动回复 阅读全文
posted @ 2023-03-06 20:45 myrj 阅读(719) 评论(0) 推荐(0)
摘要:#include <stdio.h> //编写一个程序,输入一个整数n,判断其是否为完数 //如果一个数等于它的因子之和,则称该数为完数或完全数 //例如6=1+2+3,因此6是完数 main() { int i,n,s; s=1; printf("请输入一个整数:"); scanf("%d",&n 阅读全文
posted @ 2023-03-06 20:34 myrj 阅读(1260) 评论(0) 推荐(0)
摘要:transformers Hugging Face点击Create new secret key按钮即可。API Key目前都是以sk-开头的。要注意的是,创建后应该立即复制并妥善保存API Key。因为OpenAI为了保证API Key的安全,只在创建API Key时才会完整显示API Key,如 阅读全文
posted @ 2023-03-06 19:49 myrj 阅读(698) 评论(0) 推荐(0)
摘要:#include<stdio.h> //用固定位置的数与其他数比较 main() { int a[10]={88,2,3,4,5,6,100,33,58,0},i,j,t,c; for(i=0;i<10;i++) for(j=i+1;j<10;j++) if(a[i]>a[j]) { t=a[j]; 阅读全文
posted @ 2023-03-06 14:18 myrj 阅读(60) 评论(0) 推荐(0)
摘要:sysuse auto, clear tab mpg,m recode mpg (10/19=.) (20/29=2) (30/39=6) (40/49=10) tab mpg,m 阅读全文
posted @ 2023-03-06 11:33 myrj 阅读(200) 评论(0) 推荐(0)
摘要:webuse auto, clear //1.删除mpg重复的数据,只保留一行,结果每行的mpg值不相同 duplicates drop mpg,force //方法2: bys mpg:gen filter=_n keep if filter==1 阅读全文
posted @ 2023-03-06 11:28 myrj 阅读(255) 评论(0) 推荐(0)
摘要:webuse auto, clear brow isid price isid mpg sample 10 //修改变量名price的标签 label variable price "my price" label variable foreign "Car originz" //删除指定变量tur 阅读全文
posted @ 2023-03-06 10:31 myrj 阅读(4503) 评论(0) 推荐(0)
摘要:#include <stdio.h> //求任意两个数的最小公倍数 main() { int a,b,i; scanf("%d%d",&a,&b); for(i=a;i<=a*b;i++) if(i%a==0 && i%b==0) { printf("%d %d的最小公倍数为:%d\n",a,b,i 阅读全文
posted @ 2023-03-05 20:35 myrj 阅读(269) 评论(0) 推荐(0)
摘要://替换所有空格 //下面语句结果为4 disp length(subinstr(" 123 3 "," ","",.)) //itrim(s) 将字符间多于一个空格缩减为一个空格,对首尾空格不起作用 disp length(itrim(" 123 3 ")) 替换变量中的中文符号 replace 阅读全文
posted @ 2023-03-05 19:46 myrj 阅读(2487) 评论(0) 推荐(0)
摘要://截取make值的第5 6 7三个字符作为新变量avvv的值 gen avvv=substr(make,5,3) order avvv ,after(make) //substr(s,n1,n2) 用法:s为需要提取的字符串,n1表示提取的起始位置,n2表示要提取的字符字符串的长度。如果n1 < 阅读全文
posted @ 2023-03-05 19:06 myrj 阅读(3534) 评论(0) 推荐(0)
摘要:STATA:字符型 数值型变量转换 //real()将字符转为数字 gen a6=price+real("1") //将变量a6的类型设置为int(原来浮点型) recast int a6 //将变量a6的类型由int转为str tostring a6,replace //将变量a6的类型由str转 阅读全文
posted @ 2023-03-05 18:47 myrj 阅读(7821) 评论(0) 推荐(0)
摘要://word函数是以空格为界 //word(s,n) 取得字符串s的第n个单词 // make a1 a2 //make:AMC Concord Concord AMC order a1 a2,after(make) //返回变量make的第2个单词 gen a3=word(make,2) //返回 阅读全文
posted @ 2023-03-05 15:26 myrj 阅读(218) 评论(0) 推荐(0)
摘要:STATA每次打开自动记录单独的日志,不覆盖,便于分析错误原因 //将当前相关代码复制到stata安装目录下的profile.do文件中 //每次打开stata自动保存日志不丢失,不覆盖,以打开stata时日期时间为日志文件名,便于分析错误找原因 local wjm=subinstr(subinst 阅读全文
posted @ 2023-03-05 11:12 myrj 阅读(278) 评论(0) 推荐(0)
摘要:cond(ifc, a, b):条件 ifc 为真时,返回 a, 否则返回 b inrange(x, a, b):如果变量x取值在a 至b之间时,该变量取 1,反之取 0 inlist(x, a, b, ...):如果变量x取值包含a,b,...等取值时,该变量取 1,反之取 0 clip(x, a 阅读全文
posted @ 2023-03-05 10:50 myrj 阅读(542) 评论(0) 推荐(0)
摘要:length("asdf") //检测字符串长度 //*命令 subinstr(S1,S2,S3,n),n表示迭代的次数,S1是变量,S2是需要替代的变量,S3是新替换的变量。如果n是.代表所有的都换*/ //reverse()字符串逆顺 local wjm="`c(current_time)'`c 阅读全文
posted @ 2023-03-05 09:23 myrj 阅读(535) 评论(0) 推荐(0)
摘要:display "`c(current_time)' `c(current_date)'" local wjm="`c(current_time)'`c(current_date)'" wjm=subintstr(local wjm,":","",2) disp local wjm 阅读全文
posted @ 2023-03-05 06:21 myrj 阅读(276) 评论(0) 推荐(0)
摘要://求余数:mod(_n,2)==0 use auto1, clear replace price=price+10 if mod(_n,2)==0 abs(x) 绝对值 abs(-9)=9 comb(n,k) 从n中取k个的组合 comb(10,2)=45 exp(x) 指数 exp(0)=1 f 阅读全文
posted @ 2023-03-05 05:20 myrj 阅读(593) 评论(0) 推荐(0)
摘要:webuse auto, clear //写两个命令,先排序,再建立新变量 //根据foreign排序,新生新变量,其值是不同的foreign分别从1开始计数 sort foreign by foreign:gen filter=_n //上面两个命令写成一个命令,功能相同 bys foreign, 阅读全文
posted @ 2023-03-05 05:15 myrj 阅读(69) 评论(0) 推荐(0)
摘要:import pandas as pd from pandas.io.stata import StataReader, StataWriter file="cfps2020famconf_202301.dta" stata_data = StataReader(file, convert_cate 阅读全文
posted @ 2023-03-04 11:34 myrj 阅读(115) 评论(0) 推荐(0)
摘要:import pandas as pd data = pd.read_stata('cfps2020famconf_202301.dta') data.to_stata('output_file.dta') data.to_stata('output_file.dta', version=12) # 阅读全文
posted @ 2023-03-04 11:15 myrj 阅读(297) 评论(0) 推荐(0)
摘要:from Crypto.Cipher import PKCS1_v1_5 as PKCS1_cipher ModuleNotFoundError: No module named 'Crypto' 解决方法: pip install pycryptodome 阅读全文
posted @ 2023-03-04 09:15 myrj 阅读(1331) 评论(0) 推荐(0)
摘要://建立新变量vv,其值:trunk只能为11或17,mpg可以从18-30间时为1,其他为0 gen vv=inlist(trunk,11,17)&inrange(mpg,18,30) //建立新变量vva,其值:trunk为11-17,mpg可以从18-30间时为1,其他为0 gen vva=i 阅读全文
posted @ 2023-03-04 08:40 myrj 阅读(440) 评论(0) 推荐(0)
摘要:sysuse auto,clear //遍历显示所有变量名 foreach v of varlist _all { dis "`v'" } //显示当前记录各个变量的值 foreach v of varlist _all { dis `v' } //ds显示所有变量名,只有变量名 ds foreac 阅读全文
posted @ 2023-03-04 08:38 myrj 阅读(1721) 评论(0) 推荐(0)
摘要:local varsa rep78 headroom trunk weight length turn displacement gear_ratio foreign local nv=10 foreach var of local varsa{ rename `var' `var'`nv' } / 阅读全文
posted @ 2023-03-04 07:27 myrj 阅读(1018) 评论(0) 推荐(0)