df['tmp_RXCUI'] = df.loc[:, 'RXCUI']
# drop orig
df.drop(columns=['RXCUI'])
# create new
rxcui_dict = list_to_json(rxcui_items)
df['tmp_RXCUI'] = df.apply(
lambda x: update_df_item(x, rxcui_dict),
axis=1, result_type='expand')
df['RXCUI'] = df.loc[:, 'tmp_RXCUI']
df.drop(columns=['tmp_RXCUI'])
with open('/path/to/some/file/you/want/to/read') as file_1, \
open('/path/to/some/file/being/written', 'w') as file_2:
file_2.write(file_1.read())