-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.2023-11-11-file-1.ipynb.sage-jupyter2
31 lines (31 loc) · 54.1 KB
/
.2023-11-11-file-1.ipynb.sage-jupyter2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{"backend_state":"running","connection_file":"/tmp/xdg-runtime-user/jupyter/kernel-8b91f245-9ba2-405e-b50d-e35a9e3e5d88.json","kernel":"python3","kernel_error":"","kernel_state":"idle","last_ipynb_save":1699724611985,"trust":true,"type":"settings"}
{"cell_type":"code","id":"79e62d","input":"import pandas as pd\nimport scipy.stats\n\n# Your dataset\ndataset = pd.DataFrame({\"wa","pos":21.5,"type":"cell"}
{"cell_type":"markdown","id":"7e9be3","input":"python\n# Import necessary libraries\nimport pandas as pd\n\n Create a new DataFrame for walking with dogs group\nwalking_with_dogs = dataset[dataset['group'] == 'walking_with_dogs']\n\n# Create a new DataFrame for walking without dogs group\nwalking_without_dogs = dataset[dataset['group'] == 'walking_without_dogs']\n\n# Print the descriptive statistics for walking with dogs group\nprint(\"Descriptive statistics for walking with dogs group:\")\nprint(walking_with_dogs.describe())\n\n# Print the descriptive statistics for walking without dogs group\nprint(\"Descriptive statistics for walking without dogs group:\")\nprint(walking_without_dogs.describe())\n```","pos":16,"type":"cell"}
{"cell_type":"markdown","id":"bcc231","input":"The following cell was generated by GPT-3.5 using this user prompt:\n\n> I want to get a summary of descriptive statistics for this dataset. That is I want to get the descriptive statistics for the walking with dogs group and walking without dogs \n\n ","pos":15,"type":"cell"}
{"cell_type":"markdown","id":"c9cc65","input":"The following cell was generated by GPT-3.5 using this user prompt:\n\n> I want to create a dataset with two variable walking_with_dogs and waolking_without_dogs using pandas \n\n\n ","pos":8,"type":"cell"}
{"cell_type":"markdown","id":"de58e0","input":"``python\nimport pandas as pd\n\n# Create a DataFrame named \"dataset\" with columns \"walking_with_dogs\" and \"walking_without_dogs\"\n\ndataset = pd.DataFrame({\n \"walking_with_dogs\": [],\n \"walking_without_dogs\": []\n})\n\n```\n%whos\n```\n\n````\n\n","pos":9,"type":"cell"}
{"end":1699720363395,"exec_count":3,"id":"0bbecf","input":"%pip install pyreadstat","kernel":"python3","output":{"0":{"name":"stdout","text":"Defaulting to user installation because normal site-packages is not writeable\r\n"},"1":{"name":"stdout","text":"Requirement already satisfied: pyreadstat in /usr/local/lib/python3.10/dist-packages (1.1.9)\r\n"},"2":{"name":"stdout","text":"Requirement already satisfied: pandas>=1.2.0 in /home/user/.local/lib/python3.10/site-packages (from pyreadstat) (1.5.3)\r\n"},"3":{"name":"stdout","text":"Requirement already satisfied: python-dateutil>=2.8.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.2.0->pyreadstat) (2.8.2)\r\nRequirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.2.0->pyreadstat) (2023.3.post1)\r\nRequirement already satisfied: numpy>=1.21.0 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.2.0->pyreadstat) (1.22.4)\r\n"},"4":{"name":"stdout","text":"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.1->pandas>=1.2.0->pyreadstat) (1.16.0)\r\n"},"5":{"name":"stdout","text":"\r\n\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.3\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.3.1\u001b[0m\r\n\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython3 -m pip install --upgrade pip\u001b[0m\r\n"},"6":{"name":"stdout","text":"Note: you may need to restart the kernel to use updated packages.\n"}},"pos":0,"start":1699720345796,"state":"done","type":"cell"}
{"end":1699720373174,"exec_count":4,"id":"5718c2","input":"import pandas as pd ","kernel":"python3","pos":1,"start":1699720365702,"state":"done","type":"cell"}
{"end":1699720386254,"exec_count":5,"id":"9ca79a","input":"ls()","kernel":"python3","output":{"0":{"name":"stdout","text":"/usr/bin/sh: 1: Syntax error: \"(\" unexpected\r\n"}},"pos":2,"start":1699720386143,"state":"done","type":"cell"}
{"end":1699720394331,"exec_count":6,"id":"4b2422","input":"!ls","kernel":"python3","output":{"0":{"name":"stdout","text":"2023-09-12-file-1.term\t _bookdown.yml\t cripto_update_files\r\n2023-10-13-file-1.term\t _extensions\t\t first_steps.ipynb\r\n2023-11-01-file-1.ipynb capitolo1.html\t intro.rmd\r\n2023-11-01-terminal-1.term capitolo1.ipynb\t meta-analisi.Rproj\r\n2023-11-06-file-1.term\t capitolo1.rmd\t references.bib\r\n2023-11-11-file-1.ipynb capitolo1_files\t references.bib.blg\r\nFigures\t\t\t cripto_update.Rmd\t references_bibertool.bib\r\nREADME.md\t\t cripto_update.html\t state.csv\r\nSpeed_and_distance.Rmd\t cripto_update.ipynb\r\nStatistica_Python.ipynb cripto_update.pdf\r\n"}},"pos":3,"start":1699720394216,"state":"done","type":"cell"}
{"end":1699720399329,"exec_count":7,"id":"5b1d43","input":"!pwd","kernel":"python3","output":{"0":{"name":"stdout","text":"/home/user/meta-analysis\r\n"}},"pos":4,"start":1699720399217,"state":"done","type":"cell"}
{"end":1699722396117,"exec_count":8,"id":"869ad6","input":"dataset = pd.read_spss(\"ch02_dogwalking 2.sav\")","kernel":"python3","pos":5,"start":1699722395938,"state":"done","type":"cell"}
{"end":1699722414118,"exec_count":10,"id":"00e37c","input":"dataset","kernel":"python3","output":{"0":{"data":{"text/html":"<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>WALKCOND</th>\n <th>ENCNTRS</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>1.0</td>\n <td>9.0</td>\n </tr>\n <tr>\n <th>1</th>\n <td>1.0</td>\n <td>7.0</td>\n </tr>\n <tr>\n <th>2</th>\n <td>1.0</td>\n <td>10.0</td>\n </tr>\n <tr>\n <th>3</th>\n <td>1.0</td>\n <td>12.0</td>\n </tr>\n <tr>\n <th>4</th>\n <td>1.0</td>\n <td>6.0</td>\n </tr>\n <tr>\n <th>5</th>\n <td>1.0</td>\n <td>8.0</td>\n </tr>\n <tr>\n <th>6</th>\n <td>2.0</td>\n <td>4.0</td>\n </tr>\n <tr>\n <th>7</th>\n <td>2.0</td>\n <td>5.0</td>\n </tr>\n <tr>\n <th>8</th>\n <td>2.0</td>\n <td>3.0</td>\n </tr>\n <tr>\n <th>9</th>\n <td>2.0</td>\n <td>6.0</td>\n </tr>\n <tr>\n <th>10</th>\n <td>2.0</td>\n <td>5.0</td>\n </tr>\n <tr>\n <th>11</th>\n <td>2.0</td>\n <td>1.0</td>\n </tr>\n </tbody>\n</table>\n</div>","text/plain":" WALKCOND ENCNTRS\n0 1.0 9.0\n1 1.0 7.0\n2 1.0 10.0\n3 1.0 12.0\n4 1.0 6.0\n5 1.0 8.0\n6 2.0 4.0\n7 2.0 5.0\n8 2.0 3.0\n9 2.0 6.0\n10 2.0 5.0\n11 2.0 1.0"},"exec_count":10}},"pos":6,"start":1699722414083,"state":"done","type":"cell"}
{"end":1699722857614,"exec_count":11,"id":"1ed1c6","input":"%whos","kernel":"python3","output":{"0":{"name":"stdout","text":"Variable Type Data/Info\n-----------------------------------\ndataset DataFrame WALKCOND ENCNTRS\\n0 <...>.0\\n11 2.0 1.0\nmatplotlib module <module 'matplotlib' from<...>/matplotlib/__init__.py'>\nos module <module 'os' from '/usr/lib/python3.10/os.py'>\npd module <module 'pandas' from '/h<...>ages/pandas/__init__.py'>\n"}},"pos":10,"start":1699722857611,"state":"done","type":"cell"}
{"end":1699722864501,"exec_count":12,"id":"77a548","input":"del dataset","kernel":"python3","pos":11,"start":1699722864498,"state":"done","type":"cell"}
{"end":1699723258934,"exec_count":14,"id":"82694b","input":"dataset=pd.DataFrame({\"walking_with_dogs\":[9,7,10,12,6,8],\"walking_without_dogs\":[4,5,3,6,5,1]})","kernel":"python3","pos":12,"start":1699723258931,"state":"done","type":"cell"}
{"end":1699723267782,"exec_count":15,"id":"39ea5c","input":"dataset","kernel":"python3","output":{"0":{"data":{"text/html":"<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>walking_with_dogs</th>\n <th>walking_without_dogs</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>9</td>\n <td>4</td>\n </tr>\n <tr>\n <th>1</th>\n <td>7</td>\n <td>5</td>\n </tr>\n <tr>\n <th>2</th>\n <td>10</td>\n <td>3</td>\n </tr>\n <tr>\n <th>3</th>\n <td>12</td>\n <td>6</td>\n </tr>\n <tr>\n <th>4</th>\n <td>6</td>\n <td>5</td>\n </tr>\n <tr>\n <th>5</th>\n <td>8</td>\n <td>1</td>\n </tr>\n </tbody>\n</table>\n</div>","text/plain":" walking_with_dogs walking_without_dogs\n0 9 4\n1 7 5\n2 10 3\n3 12 6\n4 6 5\n5 8 1"},"exec_count":15}},"pos":13,"start":1699723267780,"state":"done","type":"cell"}
{"end":1699723532564,"exec_count":16,"id":"48aecc","input":"dataset.describe","kernel":"python3","output":{"0":{"data":{"text/plain":"<bound method NDFrame.describe of walking_with_dogs walking_without_dogs\n0 9 4\n1 7 5\n2 10 3\n3 12 6\n4 6 5\n5 8 1>"},"exec_count":16}},"pos":17,"start":1699723532561,"state":"done","type":"cell"}
{"end":1699723773869,"exec_count":17,"id":"af854c","input":"summary_statistics=dataset.describe()","kernel":"python3","pos":18,"start":1699723773812,"state":"done","type":"cell"}
{"end":1699723779794,"exec_count":18,"id":"d199b1","input":"summary_statistics","kernel":"python3","output":{"0":{"data":{"text/html":"<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>walking_with_dogs</th>\n <th>walking_without_dogs</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>count</th>\n <td>6.000000</td>\n <td>6.000000</td>\n </tr>\n <tr>\n <th>mean</th>\n <td>8.666667</td>\n <td>4.000000</td>\n </tr>\n <tr>\n <th>std</th>\n <td>2.160247</td>\n <td>1.788854</td>\n </tr>\n <tr>\n <th>min</th>\n <td>6.000000</td>\n <td>1.000000</td>\n </tr>\n <tr>\n <th>25%</th>\n <td>7.250000</td>\n <td>3.250000</td>\n </tr>\n <tr>\n <th>50%</th>\n <td>8.500000</td>\n <td>4.500000</td>\n </tr>\n <tr>\n <th>75%</th>\n <td>9.750000</td>\n <td>5.000000</td>\n </tr>\n <tr>\n <th>max</th>\n <td>12.000000</td>\n <td>6.000000</td>\n </tr>\n </tbody>\n</table>\n</div>","text/plain":" walking_with_dogs walking_without_dogs\ncount 6.000000 6.000000\nmean 8.666667 4.000000\nstd 2.160247 1.788854\nmin 6.000000 1.000000\n25% 7.250000 3.250000\n50% 8.500000 4.500000\n75% 9.750000 5.000000\nmax 12.000000 6.000000"},"exec_count":18}},"pos":19,"start":1699723779787,"state":"done","type":"cell"}
{"end":1699724069506,"exec_count":19,"id":"6abfb6","input":"import scipy.stats","kernel":"python3","pos":20,"start":1699724069504,"state":"done","type":"cell"}
{"end":1699724165123,"exec_count":22,"id":"3ef83a","input":"import pandas as pd\nimport scipy.stats\n\n# Your dataset\ndataset = pd.DataFrame({\"walking_with_dogs\": [9, 7, 10, 12, 6, 8],\n \"walking_without_dogs\": [4, 5, 3, 6, 5, 1]})\n\n# Function to calculate 5% trimmed mean\ndef trimmed_mean(data, trim_percent):\n return scipy.stats.trim_mean(data, trim_percent)\n\n# Additional statistics\nsummary = {}\nfor column in dataset.columns:\n confidence_interval = scipy.stats.t.interval(0.95, len(dataset[column])-1, loc=dataset[column].mean(), scale=scipy.stats.sem(dataset[column]))\n trimmed_mean_5percent = trimmed_mean(dataset[column], 0.05)\n median = dataset[column].median()\n variance = dataset[column].var()\n data_range = dataset[column].max() - dataset[column].min()\n iqr = scipy.stats.iqr(dataset[column])\n skewness = scipy.stats.skew(dataset[column])\n kurtosis = scipy.stats.kurtosis(dataset[column])\n\n stats = {\n 'Confidence Interval': confidence_interval,\n 'Trimmed Mean (5%)': trimmed_mean_5percent,\n 'Median': median,\n 'Variance': variance,\n 'Range': data_range,\n 'Interquartile Range': iqr,\n 'Skewness': skewness,\n 'Kurtosis': kurtosis\n }\n\n summary[column] = stats\n\nsummary_statistics = pd.DataFrame(summary)\n\nprint(summary_statistics)","kernel":"python3","output":{"0":{"name":"stdout","text":" walking_with_dogs \\\nConfidence Interval (6.399626578525909, 10.933706754807423) \nTrimmed Mean (5%) 8.666667 \nMedian 8.5 \nVariance 4.666667 \nRange 6 \nInterquartile Range 2.5 \nSkewness 0.338062 \nKurtosis -0.96 \n\n walking_without_dogs \nConfidence Interval (2.1227124562307305, 5.8772875437692695) \nTrimmed Mean (5%) 4.0 \nMedian 4.5 \nVariance 3.2 \nRange 5 \nInterquartile Range 1.75 \nSkewness -0.688919 \nKurtosis -0.65625 \n"}},"pos":23,"start":1699724165116,"state":"done","type":"cell"}
{"end":1699724432977,"exec_count":23,"id":"8ceb09","input":"del dataset","kernel":"python3","pos":24,"start":1699724432966,"state":"done","type":"cell"}
{"end":1699724500472,"exec_count":25,"id":"0ee02a","input":"import pandas as pd\n\n# Your dataset\ndataset = pd.DataFrame({\"walking_with_dogs\": [9, 7, 10, 12, 6, 8],\n \"walking_without_dogs\": [4, 5, 3, 6, 5, 1]})\n\n# Define a function for 5% trimmed mean\ndef trimmed_mean_5percent(x):\n return pd.Series([x.quantile(0.05), x.quantile(0.95)], index=['5%', '95%'])\n\n# Calculate summary statistics\nsummary_statistics = dataset.agg(['mean', 'std', 'min', '25%', '50%', '75%', 'max', trimmed_mean_5percent, 'var', 'ptp', 'quantile', 'skew', 'kurt'])\n\n# Transpose for better readability\nsummary_statistics = summary_statistics.T.rename(columns={'50%': 'Median', 'trimmed_mean_5percent': 'Trimmed Mean (5%)'})\n\nprint(summary_statistics)","kernel":"python3","output":{"0":{"ename":"AttributeError","evalue":"'25%' is not a valid function for 'Series' object","traceback":["\u001b[0;31m---------------------------------------------------------------------------\u001b[0m","\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)","Cell \u001b[0;32mIn[25], line 12\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m pd\u001b[38;5;241m.\u001b[39mSeries([x\u001b[38;5;241m.\u001b[39mquantile(\u001b[38;5;241m0.05\u001b[39m), x\u001b[38;5;241m.\u001b[39mquantile(\u001b[38;5;241m0.95\u001b[39m)], index\u001b[38;5;241m=\u001b[39m[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m5\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m95\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[1;32m 11\u001b[0m \u001b[38;5;66;03m# Calculate summary statistics\u001b[39;00m\n\u001b[0;32m---> 12\u001b[0m summary_statistics \u001b[38;5;241m=\u001b[39m \u001b[43mdataset\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mmean\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mstd\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mmin\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m25\u001b[39;49m\u001b[38;5;124;43m%\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m50\u001b[39;49m\u001b[38;5;124;43m%\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m75\u001b[39;49m\u001b[38;5;124;43m%\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mmax\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtrimmed_mean_5percent\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mvar\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mptp\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mquantile\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mskew\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mkurt\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 14\u001b[0m \u001b[38;5;66;03m# Transpose for better readability\u001b[39;00m\n\u001b[1;32m 15\u001b[0m summary_statistics \u001b[38;5;241m=\u001b[39m summary_statistics\u001b[38;5;241m.\u001b[39mT\u001b[38;5;241m.\u001b[39mrename(columns\u001b[38;5;241m=\u001b[39m{\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m50\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mMedian\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtrimmed_mean_5percent\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mTrimmed Mean (5\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m)\u001b[39m\u001b[38;5;124m'\u001b[39m})\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/frame.py:9342\u001b[0m, in \u001b[0;36mDataFrame.aggregate\u001b[0;34m(self, func, axis, *args, **kwargs)\u001b[0m\n\u001b[1;32m 9339\u001b[0m relabeling, func, columns, order \u001b[38;5;241m=\u001b[39m reconstruct_func(func, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 9341\u001b[0m op \u001b[38;5;241m=\u001b[39m frame_apply(\u001b[38;5;28mself\u001b[39m, func\u001b[38;5;241m=\u001b[39mfunc, axis\u001b[38;5;241m=\u001b[39maxis, args\u001b[38;5;241m=\u001b[39margs, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[0;32m-> 9342\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mop\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 9344\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m relabeling:\n\u001b[1;32m 9345\u001b[0m \u001b[38;5;66;03m# This is to keep the order to columns occurrence unchanged, and also\u001b[39;00m\n\u001b[1;32m 9346\u001b[0m \u001b[38;5;66;03m# keep the order of new columns occurrence unchanged\u001b[39;00m\n\u001b[1;32m 9347\u001b[0m \n\u001b[1;32m 9348\u001b[0m \u001b[38;5;66;03m# For the return values of reconstruct_func, if relabeling is\u001b[39;00m\n\u001b[1;32m 9349\u001b[0m \u001b[38;5;66;03m# False, columns and order will be None.\u001b[39;00m\n\u001b[1;32m 9350\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m columns \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:776\u001b[0m, in \u001b[0;36mFrameApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 774\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 775\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 776\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 777\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m 778\u001b[0m exc \u001b[38;5;241m=\u001b[39m \u001b[38;5;167;01mTypeError\u001b[39;00m(\n\u001b[1;32m 779\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mDataFrame constructor called with \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 780\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mincompatible data and dtype: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00merr\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 781\u001b[0m )\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:175\u001b[0m, in \u001b[0;36mApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 172\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39magg_dict_like()\n\u001b[1;32m 173\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m is_list_like(arg):\n\u001b[1;32m 174\u001b[0m \u001b[38;5;66;03m# we require a list, but not a 'str'\u001b[39;00m\n\u001b[0;32m--> 175\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg_list_like\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m callable(arg):\n\u001b[1;32m 178\u001b[0m f \u001b[38;5;241m=\u001b[39m com\u001b[38;5;241m.\u001b[39mget_cython_func(arg)\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:401\u001b[0m, in \u001b[0;36mApply.agg_list_like\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 394\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 395\u001b[0m \u001b[38;5;66;03m# Capture and suppress any warnings emitted by us in the call\u001b[39;00m\n\u001b[1;32m 396\u001b[0m \u001b[38;5;66;03m# to agg below, but pass through any warnings that were\u001b[39;00m\n\u001b[1;32m 397\u001b[0m \u001b[38;5;66;03m# generated otherwise.\u001b[39;00m\n\u001b[1;32m 398\u001b[0m \u001b[38;5;66;03m# This is necessary because of https://bugs.python.org/issue29672\u001b[39;00m\n\u001b[1;32m 399\u001b[0m \u001b[38;5;66;03m# See GH #43741 for more details\u001b[39;00m\n\u001b[1;32m 400\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m warnings\u001b[38;5;241m.\u001b[39mcatch_warnings(record\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m record:\n\u001b[0;32m--> 401\u001b[0m new_res \u001b[38;5;241m=\u001b[39m \u001b[43mcolg\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maggregate\u001b[49m\u001b[43m(\u001b[49m\u001b[43marg\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 402\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(record) \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 403\u001b[0m match \u001b[38;5;241m=\u001b[39m re\u001b[38;5;241m.\u001b[39mcompile(depr_nuisance_columns_msg\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m.*\u001b[39m\u001b[38;5;124m\"\u001b[39m))\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/series.py:4605\u001b[0m, in \u001b[0;36mSeries.aggregate\u001b[0;34m(self, func, axis, *args, **kwargs)\u001b[0m\n\u001b[1;32m 4602\u001b[0m func \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mdict\u001b[39m(kwargs\u001b[38;5;241m.\u001b[39mitems())\n\u001b[1;32m 4604\u001b[0m op \u001b[38;5;241m=\u001b[39m SeriesApply(\u001b[38;5;28mself\u001b[39m, func, convert_dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, args\u001b[38;5;241m=\u001b[39margs, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[0;32m-> 4605\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mop\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4606\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:1126\u001b[0m, in \u001b[0;36mSeriesApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1125\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21magg\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m-> 1126\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1127\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m result \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 1128\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mf\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:175\u001b[0m, in \u001b[0;36mApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 172\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39magg_dict_like()\n\u001b[1;32m 173\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m is_list_like(arg):\n\u001b[1;32m 174\u001b[0m \u001b[38;5;66;03m# we require a list, but not a 'str'\u001b[39;00m\n\u001b[0;32m--> 175\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg_list_like\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m callable(arg):\n\u001b[1;32m 178\u001b[0m f \u001b[38;5;241m=\u001b[39m com\u001b[38;5;241m.\u001b[39mget_cython_func(arg)\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:378\u001b[0m, in \u001b[0;36mApply.agg_list_like\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 376\u001b[0m colg \u001b[38;5;241m=\u001b[39m obj\u001b[38;5;241m.\u001b[39m_gotitem(selected_obj\u001b[38;5;241m.\u001b[39mname, ndim\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m, subset\u001b[38;5;241m=\u001b[39mselected_obj)\n\u001b[1;32m 377\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 378\u001b[0m new_res \u001b[38;5;241m=\u001b[39m \u001b[43mcolg\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maggregate\u001b[49m\u001b[43m(\u001b[49m\u001b[43ma\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 380\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m:\n\u001b[1;32m 381\u001b[0m failed_names\u001b[38;5;241m.\u001b[39mappend(com\u001b[38;5;241m.\u001b[39mget_callable_name(a) \u001b[38;5;129;01mor\u001b[39;00m a)\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/series.py:4605\u001b[0m, in \u001b[0;36mSeries.aggregate\u001b[0;34m(self, func, axis, *args, **kwargs)\u001b[0m\n\u001b[1;32m 4602\u001b[0m func \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mdict\u001b[39m(kwargs\u001b[38;5;241m.\u001b[39mitems())\n\u001b[1;32m 4604\u001b[0m op \u001b[38;5;241m=\u001b[39m SeriesApply(\u001b[38;5;28mself\u001b[39m, func, convert_dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, args\u001b[38;5;241m=\u001b[39margs, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[0;32m-> 4605\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mop\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4606\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:1126\u001b[0m, in \u001b[0;36mSeriesApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1125\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21magg\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m-> 1126\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1127\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m result \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 1128\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mf\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:169\u001b[0m, in \u001b[0;36mApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 166\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mkwargs\n\u001b[1;32m 168\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(arg, \u001b[38;5;28mstr\u001b[39m):\n\u001b[0;32m--> 169\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mapply_str\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 171\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m is_dict_like(arg):\n\u001b[1;32m 172\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39magg_dict_like()\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:580\u001b[0m, in \u001b[0;36mApply.apply_str\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 578\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maxis \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 579\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mOperation \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mf\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m does not support axis=1\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m--> 580\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_try_aggregate_string_function\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobj\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:662\u001b[0m, in \u001b[0;36mApply._try_aggregate_string_function\u001b[0;34m(self, obj, arg, *args, **kwargs)\u001b[0m\n\u001b[1;32m 658\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m f \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(obj, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m__array__\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 659\u001b[0m \u001b[38;5;66;03m# in particular exclude Window\u001b[39;00m\n\u001b[1;32m 660\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m f(obj, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m--> 662\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\n\u001b[1;32m 663\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00marg\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m is not a valid function for \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mtype\u001b[39m(obj)\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m object\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 664\u001b[0m )\n","\u001b[0;31mAttributeError\u001b[0m: '25%' is not a valid function for 'Series' object"]}},"pos":25,"start":1699724500378,"state":"done","type":"cell"}
{"end":1699724531527,"exec_count":26,"id":"db9402","input":"import pandas as pd\n\n# Your dataset\ndataset = pd.DataFrame({\"walking_with_dogs\": [9, 7, 10, 12, 6, 8],\n \"walking_without_dogs\": [4, 5, 3, 6, 5, 1]})\n\n# Define a function for 5% trimmed mean\ndef trimmed_mean_5percent(x):\n return pd.Series([x.quantile(0.05), x.quantile(0.95)], index=['5%', '95%'])\n\n# Calculate summary statistics\nsummary_statistics = dataset.agg(['mean', 'std', 'min', '25%', '50%', '75%', 'max', trimmed_mean_5percent, 'var', 'ptp', 'quantile', 'skew', 'kurt'])\n\n# Transpose for better readability\nsummary_statistics = summary_statistics.T.rename(columns={'50%': 'Median', 'trimmed_mean_5percent': 'Trimmed Mean (5%)'})\n\nprint(summary_statistics)","kernel":"python3","output":{"0":{"ename":"AttributeError","evalue":"'25%' is not a valid function for 'Series' object","traceback":["\u001b[0;31m---------------------------------------------------------------------------\u001b[0m","\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)","Cell \u001b[0;32mIn[26], line 12\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m pd\u001b[38;5;241m.\u001b[39mSeries([x\u001b[38;5;241m.\u001b[39mquantile(\u001b[38;5;241m0.05\u001b[39m), x\u001b[38;5;241m.\u001b[39mquantile(\u001b[38;5;241m0.95\u001b[39m)], index\u001b[38;5;241m=\u001b[39m[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m5\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m95\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[1;32m 11\u001b[0m \u001b[38;5;66;03m# Calculate summary statistics\u001b[39;00m\n\u001b[0;32m---> 12\u001b[0m summary_statistics \u001b[38;5;241m=\u001b[39m \u001b[43mdataset\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mmean\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mstd\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mmin\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m25\u001b[39;49m\u001b[38;5;124;43m%\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m50\u001b[39;49m\u001b[38;5;124;43m%\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m75\u001b[39;49m\u001b[38;5;124;43m%\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mmax\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtrimmed_mean_5percent\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mvar\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mptp\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mquantile\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mskew\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mkurt\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 14\u001b[0m \u001b[38;5;66;03m# Transpose for better readability\u001b[39;00m\n\u001b[1;32m 15\u001b[0m summary_statistics \u001b[38;5;241m=\u001b[39m summary_statistics\u001b[38;5;241m.\u001b[39mT\u001b[38;5;241m.\u001b[39mrename(columns\u001b[38;5;241m=\u001b[39m{\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m50\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mMedian\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtrimmed_mean_5percent\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mTrimmed Mean (5\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m)\u001b[39m\u001b[38;5;124m'\u001b[39m})\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/frame.py:9342\u001b[0m, in \u001b[0;36mDataFrame.aggregate\u001b[0;34m(self, func, axis, *args, **kwargs)\u001b[0m\n\u001b[1;32m 9339\u001b[0m relabeling, func, columns, order \u001b[38;5;241m=\u001b[39m reconstruct_func(func, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 9341\u001b[0m op \u001b[38;5;241m=\u001b[39m frame_apply(\u001b[38;5;28mself\u001b[39m, func\u001b[38;5;241m=\u001b[39mfunc, axis\u001b[38;5;241m=\u001b[39maxis, args\u001b[38;5;241m=\u001b[39margs, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[0;32m-> 9342\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mop\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 9344\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m relabeling:\n\u001b[1;32m 9345\u001b[0m \u001b[38;5;66;03m# This is to keep the order to columns occurrence unchanged, and also\u001b[39;00m\n\u001b[1;32m 9346\u001b[0m \u001b[38;5;66;03m# keep the order of new columns occurrence unchanged\u001b[39;00m\n\u001b[1;32m 9347\u001b[0m \n\u001b[1;32m 9348\u001b[0m \u001b[38;5;66;03m# For the return values of reconstruct_func, if relabeling is\u001b[39;00m\n\u001b[1;32m 9349\u001b[0m \u001b[38;5;66;03m# False, columns and order will be None.\u001b[39;00m\n\u001b[1;32m 9350\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m columns \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:776\u001b[0m, in \u001b[0;36mFrameApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 774\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 775\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 776\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 777\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m 778\u001b[0m exc \u001b[38;5;241m=\u001b[39m \u001b[38;5;167;01mTypeError\u001b[39;00m(\n\u001b[1;32m 779\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mDataFrame constructor called with \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 780\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mincompatible data and dtype: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00merr\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 781\u001b[0m )\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:175\u001b[0m, in \u001b[0;36mApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 172\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39magg_dict_like()\n\u001b[1;32m 173\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m is_list_like(arg):\n\u001b[1;32m 174\u001b[0m \u001b[38;5;66;03m# we require a list, but not a 'str'\u001b[39;00m\n\u001b[0;32m--> 175\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg_list_like\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m callable(arg):\n\u001b[1;32m 178\u001b[0m f \u001b[38;5;241m=\u001b[39m com\u001b[38;5;241m.\u001b[39mget_cython_func(arg)\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:401\u001b[0m, in \u001b[0;36mApply.agg_list_like\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 394\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 395\u001b[0m \u001b[38;5;66;03m# Capture and suppress any warnings emitted by us in the call\u001b[39;00m\n\u001b[1;32m 396\u001b[0m \u001b[38;5;66;03m# to agg below, but pass through any warnings that were\u001b[39;00m\n\u001b[1;32m 397\u001b[0m \u001b[38;5;66;03m# generated otherwise.\u001b[39;00m\n\u001b[1;32m 398\u001b[0m \u001b[38;5;66;03m# This is necessary because of https://bugs.python.org/issue29672\u001b[39;00m\n\u001b[1;32m 399\u001b[0m \u001b[38;5;66;03m# See GH #43741 for more details\u001b[39;00m\n\u001b[1;32m 400\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m warnings\u001b[38;5;241m.\u001b[39mcatch_warnings(record\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m record:\n\u001b[0;32m--> 401\u001b[0m new_res \u001b[38;5;241m=\u001b[39m \u001b[43mcolg\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maggregate\u001b[49m\u001b[43m(\u001b[49m\u001b[43marg\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 402\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(record) \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 403\u001b[0m match \u001b[38;5;241m=\u001b[39m re\u001b[38;5;241m.\u001b[39mcompile(depr_nuisance_columns_msg\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m.*\u001b[39m\u001b[38;5;124m\"\u001b[39m))\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/series.py:4605\u001b[0m, in \u001b[0;36mSeries.aggregate\u001b[0;34m(self, func, axis, *args, **kwargs)\u001b[0m\n\u001b[1;32m 4602\u001b[0m func \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mdict\u001b[39m(kwargs\u001b[38;5;241m.\u001b[39mitems())\n\u001b[1;32m 4604\u001b[0m op \u001b[38;5;241m=\u001b[39m SeriesApply(\u001b[38;5;28mself\u001b[39m, func, convert_dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, args\u001b[38;5;241m=\u001b[39margs, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[0;32m-> 4605\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mop\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4606\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:1126\u001b[0m, in \u001b[0;36mSeriesApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1125\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21magg\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m-> 1126\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1127\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m result \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 1128\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mf\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:175\u001b[0m, in \u001b[0;36mApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 172\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39magg_dict_like()\n\u001b[1;32m 173\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m is_list_like(arg):\n\u001b[1;32m 174\u001b[0m \u001b[38;5;66;03m# we require a list, but not a 'str'\u001b[39;00m\n\u001b[0;32m--> 175\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg_list_like\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m callable(arg):\n\u001b[1;32m 178\u001b[0m f \u001b[38;5;241m=\u001b[39m com\u001b[38;5;241m.\u001b[39mget_cython_func(arg)\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:378\u001b[0m, in \u001b[0;36mApply.agg_list_like\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 376\u001b[0m colg \u001b[38;5;241m=\u001b[39m obj\u001b[38;5;241m.\u001b[39m_gotitem(selected_obj\u001b[38;5;241m.\u001b[39mname, ndim\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m, subset\u001b[38;5;241m=\u001b[39mselected_obj)\n\u001b[1;32m 377\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 378\u001b[0m new_res \u001b[38;5;241m=\u001b[39m \u001b[43mcolg\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maggregate\u001b[49m\u001b[43m(\u001b[49m\u001b[43ma\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 380\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m:\n\u001b[1;32m 381\u001b[0m failed_names\u001b[38;5;241m.\u001b[39mappend(com\u001b[38;5;241m.\u001b[39mget_callable_name(a) \u001b[38;5;129;01mor\u001b[39;00m a)\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/series.py:4605\u001b[0m, in \u001b[0;36mSeries.aggregate\u001b[0;34m(self, func, axis, *args, **kwargs)\u001b[0m\n\u001b[1;32m 4602\u001b[0m func \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mdict\u001b[39m(kwargs\u001b[38;5;241m.\u001b[39mitems())\n\u001b[1;32m 4604\u001b[0m op \u001b[38;5;241m=\u001b[39m SeriesApply(\u001b[38;5;28mself\u001b[39m, func, convert_dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, args\u001b[38;5;241m=\u001b[39margs, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[0;32m-> 4605\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mop\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4606\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:1126\u001b[0m, in \u001b[0;36mSeriesApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1125\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21magg\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m-> 1126\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magg\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1127\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m result \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 1128\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mf\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:169\u001b[0m, in \u001b[0;36mApply.agg\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 166\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mkwargs\n\u001b[1;32m 168\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(arg, \u001b[38;5;28mstr\u001b[39m):\n\u001b[0;32m--> 169\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mapply_str\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 171\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m is_dict_like(arg):\n\u001b[1;32m 172\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39magg_dict_like()\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:580\u001b[0m, in \u001b[0;36mApply.apply_str\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 578\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maxis \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 579\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mOperation \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mf\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m does not support axis=1\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m--> 580\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_try_aggregate_string_function\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobj\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/core/apply.py:662\u001b[0m, in \u001b[0;36mApply._try_aggregate_string_function\u001b[0;34m(self, obj, arg, *args, **kwargs)\u001b[0m\n\u001b[1;32m 658\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m f \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(obj, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m__array__\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 659\u001b[0m \u001b[38;5;66;03m# in particular exclude Window\u001b[39;00m\n\u001b[1;32m 660\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m f(obj, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m--> 662\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\n\u001b[1;32m 663\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00marg\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m is not a valid function for \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mtype\u001b[39m(obj)\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m object\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 664\u001b[0m )\n","\u001b[0;31mAttributeError\u001b[0m: '25%' is not a valid function for 'Series' object"]}},"pos":26,"start":1699724531353,"state":"done","type":"cell"}
{"end":1699724599772,"exec_count":27,"id":"fbab3b","input":"import pandas as pd\n\n# Your dataset\ndataset = pd.DataFrame({\"walking_with_dogs\": [9, 7, 10, 12, 6, 8],\n \"walking_without_dogs\": [4, 5, 3, 6, 5, 1]})\n\n# Define a function for 5% trimmed mean\ndef trimmed_mean_5percent(x):\n return x.quantile(0.05), x.quantile(0.95)\n\n# Calculate summary statistics\npercentiles = [0, 0.25, 0.5, 0.75, 1]\nsummary_statistics = dataset.agg(['mean', 'std', 'min', lambda x: x.quantile(0.25), 'median', lambda x: x.quantile(0.75), 'max', trimmed_mean_5percent, 'var', 'ptp', lambda x: x.quantile(0), lambda x: x.quantile(1), 'skew', 'kurt'])\n\n# Transpose for better readability\nsummary_statistics = summary_statistics.T.rename(columns={'<lambda_2>': '25%', '<lambda_4>': '75%', '<lambda_10>': 'Range', '<lambda_11>': 'Quantile 0%', '<lambda_12>': 'Quantile 100%', 'trimmed_mean_5percent': 'Trimmed Mean (5%)'})\n\nprint(summary_statistics)","kernel":"python3","output":{"0":{"name":"stdout","text":" mean std min <lambda> median <lambda> max \\\nwalking_with_dogs 8.666667 2.160247 6 7.25 8.5 9.75 12 \nwalking_without_dogs 4.0 1.788854 1 3.25 4.5 5.0 6 \n\n Trimmed Mean (5%) var ptp <lambda> <lambda> \\\nwalking_with_dogs (6.25, 11.5) 4.666667 6 6.0 12.0 \nwalking_without_dogs (1.5, 5.75) 3.2 5 1.0 6.0 \n\n skew kurt \nwalking_with_dogs 0.46291 -0.3 \nwalking_without_dogs -0.943341 0.585938 \n"}},"pos":27,"start":1699724599751,"state":"done","type":"cell"}
{"id":"17db13","input":"","pos":7,"type":"cell"}
{"id":"63b725","input":"","pos":14,"type":"cell"}
{"id":"d4eb24","input":"","pos":28,"type":"cell"}
{"id":0,"time":1699722322402,"type":"user"}
{"last_load":1699720321691,"type":"file"}