<Replace over 1M pandas values using a dictionary>...
# community-feeds
r
Replace over 1M pandas values using a dictionary Now, I'm researching about STRING network When I want to replace STRING protein to Entrez ID, I see that STRING data has over 1M pandas rows.(~11M rows) So, I tried to replace STRING protein ID(like 9606.ENSP00000~~) to Entrez ID(integer). All methods was very slow. but when I use this code, the time elapsed < 5 min. is this code not problem? Here is the code. ` def replace_string_id(self, data: pd.DataFrame, target_col: str, rename_dict: dict) -> pd.DataFrame: tmp_list = [] for...