<jupyter_start><jupyter_text>Operations for pandas dataframe1. Basic information - rows, columns, column types2. Basic statistics3. Null values4. Filter 5. ordering/sorting6. grouping7. pivot8. merge<jupyter_code>df.shape
df.info()
df.describe()
type(df.age)
df.age
df["age"]
df[["age", "gender"]]
df.iloc[:,0:2]
a = [4, 6, 1, 10, 4, 5]
a[0]
a = [4, 6, 1, 10, 4, 5]
a[0:2]
a = [4, 6, 1, 10, 4, 5]
a[0:3]
a = [4, 6, 1, 10, 4, 5]
a[:3]
a = [4, 6, 1, 10, 4, 5]
a[-1]
a = [4, 6, 1, 10, 4, 5]
a[-2:]
a = [4, 6, 1, 10, 4, 5]
a[:]
a = [4, 6, 1, 10, 4, 5]
a[::2]
a = [4, 6, 1, 10, 4, 5]
a[::-1]
a = [4, 6, 1, 10, 4, 5]
a[-3]
a = [4, 6, 1, 10, 4, 5]
a[-0]
df.iloc[:10,0:2]
df.iloc[5:15,0:2]
df.iloc[5:15,:]
df.gender == "male"
df[df.gender == "male"]
df[(df.gender == "male") & (df.age <25)]
df.query("gender == 'male' and age <20")
df.sort_values("bmi", ascending = False)
df.sort_values(["age", "bmi"], ascending = False)
df.sort_values(["age", "bmi"], ascending = [True, False])
df.groupby("gender").age.mean()
df.gender.value_counts()
df.groupby("gender").age.agg(["mean", "count"])
df.groupby("gender").agg({"age": "mean","bmi": "mean"})
df.groupby("gender").agg({"age": ["mean", "median"]
                          ,"bmi": ["mean", "median"]})
df.pivot_table("age", "gender", "region")
df.pivot_table("age", "gender", "region", aggfunc="mean")
df.pivot_table("age", "gender", "region", aggfunc="median")
df.groupby(["gender", "region"]).charges.mean().unstack()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2708333333333333, 'fraction_numerical': 0.07728494623655914, 'mean_word_length': 4.5767790262172285, 'pattern_counts': {'":': 4, '<': 7, '<?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': '289204', 'license': 'Apache-2.0', 'n_tokens_mistral': 770, 'n_tokens_neox': 680, 'n_words': 170, 'path': 'demos/Day 1 - pandas .ipynb', 'repo_name': 'ashishpatel26/Machine-Learning-and-Deep-Learning-with-sklearn-and-sparkml', 'size': '1488'}