summaryrefslogtreecommitdiff
path: root/tutorials/module_1/notebook_1/1_excel_to_python.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'tutorials/module_1/notebook_1/1_excel_to_python.ipynb')
-rw-r--r--tutorials/module_1/notebook_1/1_excel_to_python.ipynb99
1 files changed, 99 insertions, 0 deletions
diff --git a/tutorials/module_1/notebook_1/1_excel_to_python.ipynb b/tutorials/module_1/notebook_1/1_excel_to_python.ipynb
new file mode 100644
index 0000000..98d8a02
--- /dev/null
+++ b/tutorials/module_1/notebook_1/1_excel_to_python.ipynb
@@ -0,0 +1,99 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Excel to Python\n",
+ "\n",
+ "- Importing\n",
+ "- Plotting\n",
+ "- Statistical analysis\n",
+ "\n",
+ "## **How Excel Translates to Python**\n",
+ "\n",
+ "Here’s how common Excel functionalities map to Python:\n",
+ "\n",
+ "| **Excel Feature** | **Python Equivalent** |\n",
+ "|----------------------|--------------------------------------------------|\n",
+ "| Formulas (SUM, AVERAGE) | `numpy`, `pandas` (`df.sum()`, `df.mean()`) |\n",
+ "| Sorting & Filtering | `pandas.sort_values()`, `df[df['col'] > value]` |\n",
+ "| Conditional Formatting | `matplotlib` for highlighting |\n",
+ "| Pivot Tables | `pandas.pivot_table()` |\n",
+ "| Charts & Graphs | `matplotlib`, `seaborn`, `plotly` |\n",
+ "| Regression Analysis | `scipy.stats.linregress`, `sklearn.linear_model` |\n",
+ "| Solver/Optimization | `scipy.optimize` |\n",
+ "| VBA Macros | Python scripting with `openpyxl`, `pandas`, or `xlwings` |\n",
+ "\n",
+ "## Statistical functions\n",
+ "\n",
+ "#### SUM\n",
+ "\n",
+ "Built-in:\n",
+ "\n",
+ "``` python\n",
+ "my_array = [1, 2, 3, 4, 5]\n",
+ "total = sum(my_array)\n",
+ "print(total) # Output: 15\n",
+ "```\n",
+ "\n",
+ "Numpy:\n",
+ "\n",
+ "``` python\n",
+ "import numpy as np\n",
+ "\n",
+ "my_array = np.array([1, 2, 3, 4, 5])\n",
+ "total = np.sum(my_array)\n",
+ "print(total) # Output: 15\n",
+ "```\n",
+ "\n",
+ "### Average\n",
+ "\n",
+ "Built-in:\n",
+ "\n",
+ "``` python\n",
+ "my_array = [1, 2, 3, 4, 5]\n",
+ "average = sum(my_array) / len(my_array)\n",
+ "print(average) # Output: 3.0\n",
+ "```\n",
+ "\n",
+ "Numpy:\n",
+ "\n",
+ "``` python\n",
+ "import numpy as np\n",
+ "\n",
+ "my_array = np.array([1, 2, 3, 4, 5])\n",
+ "average = np.mean(my_array)\n",
+ "print(average) # Output: 3.0\n",
+ "```\n",
+ "\n",
+ "## Plotting\n",
+ "\n",
+ "We can use the package *matplotlib* to plot our graphs in python.\n",
+ "Matplotlib provides data visualization tools for the Scientific Python\n",
+ "Ecosystem. You can make very professional looking figures with this\n",
+ "tool.\n",
+ "\n",
+ "Here is a section from the matplotlib documentation page that you can\n",
+ "run in python.\n",
+ "\n",
+ "``` python\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "fig, ax = plt.subplots() # Create a figure containing a single Axes.\n",
+ "ax.plot([1, 2, 3, 4], [1, 4, 2, 3]) # Plot some data on the Axes.\n",
+ "plt.show() # Show the figure.\n",
+ "```\n",
+ "\n",
+ "Check out the documentation pages for a [simple\n",
+ "example](https://matplotlib.org/stable/users/explain/quick_start.html#a-simple-example)\n",
+ "or more information on the types of plots you came create\n",
+ "[here](https://matplotlib.org/stable/plot_types/index.html)."
+ ],
+ "id": "3e04cd8a-c731-494a-bf4f-dfe745a8a487"
+ }
+ ],
+ "nbformat": 4,
+ "nbformat_minor": 5,
+ "metadata": {}
+}