这是一个PM的BLOG
  • 首页
  • 归档
  • 分类
  • 标签
  • 关于

Numpy 的 1 维数组相关操作

np.array([1,2,3]),既不是行向量,也不是列向量,称为秩 rank 为 1 的 array,如果对其转置,则会得到其本身。 123import numpy as npb = np.array([1,2,3]) # shape=(3,)b2 = b.reshape((3,1)) # shape=(3,1) 当然也可以进行降维操作 1b3 = b2.reshape(3, ) #
2023-12-20
随笔
#Python

通过 HRV 预测运动 RPE

通过 HRV 预测 REP 核心文献为 2 篇。 《Heart Rate Variability-Based Subjective Physical Fatigue Assessment》 《Sports fatigue detection based on deep learning》 1.HRV 的相关指标1.1.时域分析 名称 单位 描述 meanNN ms 平均相邻正常心跳时
2023-12-15
ECG Project > 深度学习
#深度学习 #运动科学 #ECG

Pandas 遍历 dataframe 中的 item

数据格式为 time ecg rep 1700624658822114462 -0.157 6 采用 df.iterrows()12for item in df1.iterrows(): print(item) 输出内容为 1234(14017, time 1700624658822114462ecg -0.157rep 6Name: 14017, d
2023-11-28
随笔
#Pandas

Pandas 创建并插入数据

123456789101112ecgs = [10]times = [10]reps = [10]hrs = [10]# 创建dfdataframe = pd.DataFrame({'time': times, 'ecg': ecgs, 'rep': reps})# 插入new_df = dataframe.copy(
2023-11-28
随笔
#Pandas

Pandas 已知元素,获取其索引

例如,知道其时间戳,找到 index 123print(df[df['time'].isin([timestamp])])print(df[df['time'].isin([timestamp])].index)print(df[df['time'].isin([timestamp])].index[0]) 第一个 print 为 12
2023-11-28
随笔
#Pandas

Pandas 数据截取

知道 index 的情况下,完全可以采用 12df_copy = df.copy()df_cut = df_copy[top:bottom] 进行截取操作。
2023-11-28
随笔
#Pandas

Python 纳秒时间戳转时间

关于数量级 123456789101 秒1, 000 毫秒1, 000, 000 微秒1, 000, 000, 000 纳秒对于一个纳秒时间戳:1700621512995758338. 纳秒1700621512995758.338 微秒1700621512995.758338 毫秒1700621512.995758338 秒 转换代码 123456789101112131415from date
2023-11-28
ECG Project > 数据处理 > 其他
#Python

Python 通过 datetime 计算时间差

123456d1 = datetime.datetime.fromtimestamp(df['time'][start_index] / 1000000000)d2 = datetime.datetime.fromtimestamp(df['time'][end_index] / 1000000000)diff_d = d2-d1print('时间
2023-11-28
随笔
#Python

Python 数组中每个元素+1

方法一 12a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]a = map(lambda x:x+1,a) 方法二 12a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]a = [item+1 for item in a]
2023-11-28
随笔
#Python

解决 SettingWithCopyWarning Try using .loc[row_indexer,col_indexer] = value instead

利用 Pandas 向 DataFrame 中插入一列数据时,出现警告: 123SettingWithCopyWarning:A value is trying to be set on a copy of a slice from a DataFrame.Try using .loc[row_indexer,col_indexer] = value instead 解决办法: 先 copy 一
2023-11-28
随笔
#Pandas
1…1718192021…27

搜索

Hexo Fluid
总访问量 次 总访客数 人