numpy——
1.tile():
from numpy import *
l = array([[1,2], [3, 4]])
print("l:\n",l)
print("一行三列个l\n",tile(l, (1, 3)))
print(tile(l, 3))
print("三行一列个l:\n",tile(l, (3, 1)))
print("三行四列个l:\n",tile(l, (3, 4)))
结果:
json——
1.load()
json文件读取并转字典:
import json
with open("wenjianming.json",'r', encoding='UTF-8') as f:
load_dict = json.load(f)