Panda模块读取txt文本文件 使用pandas.read_csv函数 1. 如果txt文本中有表头(标题行) import panda as pd data = pd.read_csv('data.txt') print(data) 2. 如果txt文本中无表头 import panda as ...
分类:
编程语言 时间:
2021-04-19 15:38:55
阅读次数:
0
1.用Requests发送百度请求 新建一个requests_test.py文件,输入如下内容。 import requests #请求百度网页response = requests.get("https://www.baidu.com", data=None,timeout=10)print(re ...
分类:
其他好文 时间:
2021-04-19 15:38:03
阅读次数:
0
简单来说,expression是表达式,不是程序。 如 3 + 5, (let b = 3) in b + 5 而statement,可以理解为最短的程序。 如 a = 3 + 5 ( let a = 3 + 5) https://stackoverflow.com/questions/472807 ...
分类:
其他好文 时间:
2021-04-19 15:06:10
阅读次数:
0
#####此题我要讲一种异或优化建图 题意:某国有N座城市,编号从1到N。 (N<=1e5 , M<=5e5) 该国的交通工具主要有飞机和高铁两种对于任意的两座城市 i 和 j ,人们可以花费( i xor j ) * C 块钱从城市 i 坐飞机到城市 j ,这里 C 为该国规定的费用常数。该国有 ...
分类:
其他好文 时间:
2021-04-19 15:01:49
阅读次数:
0
恢复内容开始 # 时间分为3中格式:# 1.时间戳:从1970年到现在经过的秒数# 作用 用于时间间隔的计算print(time.time())# 2.按照某种格式显示的时间:2020-01-30 11:11:11# 作用:用于展示时间print(time.strftime('%Y-%m-%d %H ...
分类:
其他好文 时间:
2021-04-19 15:01:35
阅读次数:
0
from threading import Thread # 方式一 # def sub_thread(): # for i in range(11): # print(i) # def main(): # t = Thread(target=sub_thread) # t.start() # fo ...
分类:
编程语言 时间:
2021-04-19 14:46:14
阅读次数:
0
题目: 我们提供一个类: class FooBar { public void foo() { for (int i = 0; i < n; i++) { print("foo"); } } public void bar() { for (int i = 0; i < n; i++) { prin ...
分类:
编程语言 时间:
2021-04-19 14:40:03
阅读次数:
0
当我们程序遇到异常时,会导致程序中止运行,见如下例子: def test(): a = int(input("please input:")) b = int(input("please input:")) result = a / b print(result) def test_1(): pri ...
分类:
编程语言 时间:
2021-04-19 14:38:29
阅读次数:
0
import numpy as np a = np.array([i for i in range(5)]) b = np.array([i for i in range(5, 10)]) print('a:', a) print('b:', b) c = np.stack([a,b], axis= ...
分类:
编程语言 时间:
2021-04-16 12:25:35
阅读次数:
0
#_*_ encoding: utf-8 _*_ @author: ty heris #项目名称: pycharm_file 会自动替换为当前项目名称 #创建时间: 2018/5/6 会自动替换为当前日期 lst1 = [[0]*5]*5 print(lst1) # [[0, 0, 0, 0, 0] ...
分类:
其他好文 时间:
2021-04-16 12:15:15
阅读次数:
0