ForHeart
ForHeart
全部文章
分类
归档
标签
去牛客网
登录
/
注册
ForHeart的博客
TA的专栏
153篇文章
32人订阅
进阶高级测试工程师
142篇文章
1902人学习
AI自动测试化入门到精通
11篇文章
1292人学习
全部文章
(共158篇)
题解 | 泊松分布概率计算器
import math from scipy.stats import poisson def poisson_probability(k, lam): """ Calculate the probability of observing exactly k ev...
2025-03-03
0
132
题解 | 数组中只出现一次的两个数字
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param nums int整型一维数组 # @return int整型一维数组 # class Solution: def FindNumsAppearOnce(self , nums: L...
2025-03-03
0
65
题解 | 数组中出现次数超过一半的数字
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param numbers int整型一维数组 # @return int整型 # class Solution: def MoreThanHalfNum_Solution(self , nu...
2025-03-03
0
61
题解 | 计算协方差矩阵
import numpy as np def calculate_covariance_matrix(vectors): # 补全代码 n_features = len(vectors) n_observations = len(vectors[0]) covar...
2025-03-03
0
115
题解 | 标量的矩阵乘法
from typing import List, Union import numpy as np def scalar_multiply(matrix: List[List[Union[int, float]]], scalar: Union[int, float]) -> List[Li...
2025-03-02
0
62
题解 | 矩阵转置
from typing import List, Union import numpy as np # 使用 Union 来表示类型可以是 int 或 float def transpose_matrix(a: List[List[Union[int, float]]]) -> List[Li...
2025-03-02
2
115
题解 | 矩阵和向量的点积
import numpy as np def matrix_vector_dot_product(matrix, vector): matrix_arr = np.array(matrix) vector_arr = np.array(vector) if matrix_a...
2025-03-02
1
90
题解 | 按行或列计算平均值
from typing import List, Union import numpy as np def calculate_matrix_mean(matrix: List[List[Union[int, float]]], mode: str) -> List[float]: ...
2025-03-02
0
99
题解 | 重塑矩阵
from re import A from typing import List, Tuple, Union import numpy as np def reshape_matrix( a: List[List[Union[int, float]]], new_shape: Tuple...
2025-03-02
0
89
题解 | 矩阵和向量的点积
def matrix_vector_dot_product(matrix, vector): if not matrix or not vector: return -1 # 检查矩阵每行的列数是否一致 cols = len(matrix[0]) fo...
2025-03-02
0
121
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页