<jupyter_start><jupyter_text>Transform `Transform is an operation used in conjunction with groupby`<jupyter_code>data.groupby('order')["ext price"].sum()
data.groupby('order')['ext price'].transform('sum')
# combining order and total order using transform
data['total order'] = data.groupby('order')['ext price'].transform('sum')
data
# Percentage of order
data["Percent_of_Order"] = data["ext price"] / data["total order"]
data<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15938864628820962, 'fraction_numerical': 0.0, 'mean_word_length': 8.978260869565217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '180525', 'license': 'MIT', 'n_tokens_mistral': 142, 'n_tokens_neox': 138, 'n_words': 34, 'path': '1_Useful_Methods/12_Pandas_Transform_Groupby.ipynb', 'repo_name': 'sudevansujit/10_Machine_Learning', 'size': '458'}