摘要: 前言 在PostgreSQL 9之前的版本中,可以直接使用反斜杠\进行转义;比如:\b表示退格, \n表示换行, \t表示水平制表符,\r标示回车,\f表示换页。 除此之外还支持\digits和\xhexdigits,分别表示转义八进制和十六进制数据。 但是在PostgreSQL 9之后的版本,反斜 阅读全文
posted @ 2022-05-02 23:48 Vincent-yuan 阅读(2215) 评论(0) 推荐(0) 编辑
摘要: import pandas as pd import numpy as np df = pd.DataFrame(np.arange(12).reshape(3,4), columns=['A', 'B', 'C', 'D']) print("df",df) # df.drop([-1],inpla 阅读全文
posted @ 2022-05-02 23:43 Vincent-yuan 阅读(553) 评论(0) 推荐(0) 编辑
摘要: 更加详细的内容可以查看:https://blog.csdn.net/hhtnan/article/details/80080240 (基本函数整理) 一. DataFrame的创建 创建一个空的dataframe df=pd.DataFrame(columns={"a":"","b":"","c": 阅读全文
posted @ 2022-05-02 23:38 Vincent-yuan 阅读(1611) 评论(0) 推荐(0) 编辑
摘要: 一、准备数据 引入需用的包,并新建DataFrame例子 in [1]: import pandas as pd import numpy as np in [2]: data = pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), c 阅读全文
posted @ 2022-05-02 23:18 Vincent-yuan 阅读(12146) 评论(0) 推荐(0) 编辑
摘要: python3有threading和_thread两种线程写法,推荐使用threading。 开多线程就是为了使用多线程的异步能力来同时执行多个线程。 1. threading方法: 以下代码可以执行异步或者同步线程。 1 import threading 2 import time 3 4 5 c 阅读全文
posted @ 2022-05-02 23:08 Vincent-yuan 阅读(1753) 评论(0) 推荐(0) 编辑
摘要: 一、使用open打开文件后一定要记得调用文件对象的close()方法。 比如可以用try/finally语句来确保最后能关闭文件。 二、需要导入import os 三、下面是逐行读取文件内容的三种方法 1、第一种方法: f = open("foo.txt") # 返回一个文件对象 line = f. 阅读全文
posted @ 2022-05-02 22:57 Vincent-yuan 阅读(9392) 评论(0) 推荐(0) 编辑
摘要: 1、python中对文件、文件夹操作时经常用到的os模块和shutil模块常用方法 1.得到当前工作目录,即当前Python脚本工作的目录路径: os.getcwd() 2.返回指定目录下的所有文件和目录名:os.listdir() 3.函数用来删除一个文件:os.remove() 4.删除多个目录 阅读全文
posted @ 2022-05-02 22:49 Vincent-yuan 阅读(2668) 评论(0) 推荐(0) 编辑