<jupyter_start><jupyter_text>**Create a data Frame**<jupyter_code>raw_data = {'name': ['<NAME>', '<NAME>', '<NAME>', '<NAME>'],
        'age': [30, 29, 32, 33],
        'favorite_color': ['blue', 'red', 'yellow', "green"],
        'grade': [88, 92, 95, 70]}
df = pd.DataFrame(raw_data, index = ['<NAME>', '<NAME>', '<NAME>', '<NAME>'])
df<jupyter_output><empty_output><jupyter_text>**drop a row by name**<jupyter_code>df.drop(['<NAME>', '<NAME>'])<jupyter_output><empty_output><jupyter_text>**drop a row by number**<jupyter_code>df.drop(df.index[0], inplace=True)
df<jupyter_output><empty_output><jupyter_text>**drop first 2 rows (put ':' to left of  to drop last X rows)**<jupyter_code>df.drop(df.index[:2], inplace=True)
df<jupyter_output><empty_output><jupyter_text>**dropping column by name**<jupyter_code>df.drop(['age'], axis = 1, inplace = True)
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22372881355932203, 'fraction_numerical': 0.022598870056497175, 'mean_word_length': 7.601941747572815, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '176049', 'license': 'CC0-1.0', 'n_tokens_mistral': 368, 'n_tokens_neox': 357, 'n_words': 65, 'path': 'content/Pandas Operations/Drop Columns and Rows from Pandas Data Frame.ipynb', 'repo_name': 'risarora/mySite', 'size': '944'}