随笔分类 -  python

上一页 1 2 3 4 5 6 7 8 ··· 25 下一页
python学习
摘要:pip install pywin32 阅读全文
posted @ 2023-11-10 09:03 myrj 阅读(90) 评论(0) 推荐(0)
摘要:cap:mkdir 1012a cd D:\te\pan\2018年裁判文书数据_马克数据网 fs *.csv local shu=4 foreach file in `r(files)'{ local shu=`shu'+1 import delimited "`file'", clear cap 阅读全文
posted @ 2023-10-15 19:40 myrj 阅读(27) 评论(0) 推荐(0)
摘要:import pyodbc import pandas as pd conn = pyodbc.connect('DRIVER={SQL Server};SERVER=127.0.0.1;DATABASE=Easybook;UID=sa;PWD=') cursor = conn.cursor() c 阅读全文
posted @ 2023-10-15 07:31 myrj 阅读(91) 评论(0) 推荐(0)
摘要:import pandas as pd #生成一些数据 data = {'A': [1, 2, 3],'B': [4, 5, 6]} df = pd. DataFrame (data) #将字典转化为dataframe格式 print(df) # 打印dataframe #进行一些操作 df['A' 阅读全文
posted @ 2023-09-27 16:30 myrj 阅读(272) 评论(0) 推荐(0)
摘要:import sys from datetime import datetime import numpy as np import matplotlib.pyplot as plt #使用NumPy计算 def numpysum(n) : a = np.arange(n)**2 b = np.ar 阅读全文
posted @ 2023-09-27 15:38 myrj 阅读(54) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-09-27 15:05 myrj 阅读(9) 评论(0) 推荐(0)
摘要:>>> np.sctypeDict {'?': <class 'numpy.bool_'>, 0: <class 'numpy.bool_'>, 'byte': <class 'numpy.int8'>, 'b': <class 'numpy.int8'>, 1: <class 'numpy.int 阅读全文
posted @ 2023-09-27 11:07 myrj 阅读(98) 评论(0) 推荐(0)
摘要:import numpy as np arr=np.arange(0,10,1) arr1=np.arange(0,1,0.1) array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) array([0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 阅读全文
posted @ 2023-09-27 10:15 myrj 阅读(13) 评论(0) 推荐(0)
摘要:>>> for ii in range(1,10,0.1): print(ii) Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> for ii in range(1,10,0.1):TypeErro 阅读全文
posted @ 2023-09-27 10:11 myrj 阅读(103) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-09-26 06:11 myrj 阅读(24) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-09-26 06:05 myrj 阅读(69) 评论(0) 推荐(0)
摘要:import glob file_list = glob.glob('id2neg*.txt') # 获取文件夹下所有的txt文件 with open('merged_file.txt', 'w') as merged_file: for file_name in file_list: with o 阅读全文
posted @ 2023-09-15 07:06 myrj 阅读(50) 评论(0) 推荐(0)
摘要:import random,string,json,pymysql import pandas as pd connect = pymysql.connect(user = '', password = 'h', db = 'g, host = 'r', port = 3306, charset = 阅读全文
posted @ 2023-09-13 16:11 myrj 阅读(31) 评论(0) 推荐(0)
摘要:import sys from time import sleep import keyboard from PIL import Image,ImageGrab '''from baiDu import baiDuAPI from getText import GetText''' def scr 阅读全文
posted @ 2023-09-13 09:10 myrj 阅读(18) 评论(0) 推荐(0)
摘要:1 、筛选出数据的指定几行数据 data=df.loc[2:5] #这里的[2:5]表示第3行到第5行内容,[]第一个起始是0,表示数据的第一行 2 、筛选出数据某列为某值的所有数据记录 data = df[(df['列名1']== ‘列值1')] # 多条件匹配时 data_many=df[(df 阅读全文
posted @ 2023-09-11 18:37 myrj 阅读(25) 评论(0) 推荐(0)
摘要:ModuleNotFoundError: No module named 'Util' 分两种情况来谈这个问题。 1.第一种是没有安装出现这个问题有如下解决方法: python2安装:pip install web.py python3安装:pip install web.py==0.40-dev1 阅读全文
posted @ 2023-08-30 16:30 myrj 阅读(4676) 评论(0) 推荐(0)
摘要:#coding=utf-8 import xlwings as xw import pandas as pd import time #记录打开表单开始时间 start_open_time = time.time() #指定不显示地打开Excel,读取Excel文件 app = xw.App(vis 阅读全文
posted @ 2023-08-28 11:14 myrj 阅读(185) 评论(0) 推荐(0)
摘要:在Python的数据科学和爬虫开发中,pandas是一个非常常用的库,因为它提供了各种操作数据的函数和方法。其中,pandas可以非常方便地处理CSV和Excel文件。 CSV文件操作 CSV(Comma Separated Values)是文本文件格式之一,通常用于存储和交换表格数据。pandas 阅读全文
posted @ 2023-08-28 10:50 myrj 阅读(167) 评论(0) 推荐(0)
摘要:df1=pd.read_csv(path1,encoding="utf-8",chunksize=50000, error_bad_lines=False) 尽管提示: Warning (from warnings module): File "D:\Python37\lib\idlelib\run 阅读全文
posted @ 2023-08-24 16:06 myrj 阅读(160) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*- #from dao.updateMongo import * #from dao.insertMongo import * #from dao.selectMongo import * import pandas as pd #df = selectD 阅读全文
posted @ 2023-08-24 10:32 myrj 阅读(142) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 ··· 25 下一页