synology_link_manipultor/helper.py

10 lines
290 B
Python
Raw Normal View History

2021-07-17 21:34:36 +10:00
import os
import pandas as pd
from pathlib import Path
def append_col_inode(df: pd.DataFrame) -> pd.DataFrame:
col_inode = df.apply(lambda x: os.stat(x).st_nlink,
axis=1,
columns=['path'])
return df.assign(inode = col_inode)