<jupyter_start><jupyter_text>数值计算<jupyter_code>import pandas as pd
df = pd.DataFrame([[1,2,3],[4,5,6]], index=['a','b'],columns=['A','B','C'])
df
df.sum()
df.sum(axis=0)
df.sum(axis=1)
df.sum(axis='columns')
df.mean()
df.mean(axis='columns')
df.min()
df.max()
df.median()<jupyter_output><empty_output><jupyter_text>二元统计<jupyter_code>df = pd.read_csv('titanic_train.csv')
df.head()
 df.cov()
df.corr()
df['Age'].value_counts()
df['Age'].value_counts(ascending=True)
df['Pclass'].value_counts(ascending=True)
df['Age'].value_counts(ascending=True, bins=5)
print(help(pd.value_counts))
df['Age'].count()
df['Pclass'].count()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2411674347158218, 'fraction_numerical': 0.013824884792626729, 'mean_word_length': 11.074074074074074, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '458334', 'license': 'MIT', 'n_tokens_mistral': 302, 'n_tokens_neox': 295, 'n_words': 29, 'path': 'pandas_demo/pandas_calculate.ipynb', 'repo_name': 'ftconan/python3', 'size': '651'}