diff options
Diffstat (limited to 'tutorials/module_4/4.1 Introduction to Data and Scientific Datasets.md')
| -rw-r--r-- | tutorials/module_4/4.1 Introduction to Data and Scientific Datasets.md | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tutorials/module_4/4.1 Introduction to Data and Scientific Datasets.md b/tutorials/module_4/4.1 Introduction to Data and Scientific Datasets.md index 3ad34e4..5cd3879 100644 --- a/tutorials/module_4/4.1 Introduction to Data and Scientific Datasets.md +++ b/tutorials/module_4/4.1 Introduction to Data and Scientific Datasets.md @@ -18,6 +18,16 @@ We may collect this in the following ways: flowchart A[Collecting] --> B[Cleaning & Filtering] --> C[Analysis] --> D[Visualization] ``` +Data processing begins with **collection**, where measurements are recorded either manually using instruments or electronically through sensors. Regardless of the method, every measurement contains some degree of error, whether due to instrument limitations or external interference. In engineering, recognizing and quantifying this uncertainty is essential, as it defines the confidence range of our predictions. + +Once the data has been collected, the next step is **cleaning and filtering**. This involves addressing missing data points, managing outliers, and reducing noise. Errors can arise from faulty readings, sensor drift, or transcription mistakes. By cleaning and filtering the data, we ensure it accurately represents the system being measured. + +After the data is refined, we move into **analysis**. Here, statistical methods and computational tools are applied to model the data, uncover trends, and test hypotheses. This stage transforms raw numbers into meaningful insight. + +Finally, **visualization** allows us to communicate these insights effectively. Visualization can occur alongside analysis to guide interpretation or as the concluding step to present results clearly and purposefully. Well-designed visualizations make complex findings intuitive and accessible to the intended audience. + +To carry out this workflow efficiently, particularly during the cleaning, analysis, and visualization stages, we rely on powerful computational tools. In Python, one of the most versatile and widely used libraries for handling tabular data is pandas. It simplifies the process of managing, transforming, and analyzing datasets, allowing engineers and scientists to focus on interpreting results rather than wrestling with raw data. + ## Introduction to pandas `pandas` (**Pan**el **Da**ta) is a Python library designed for data analysis and manipulation, widely used in engineering, science, and data analytics. It provides two core data structures: the **Series** and the **DataFrame**. @@ -25,7 +35,7 @@ A `Series` represents a single column or one-dimensional labeled array, while DataFrames can be created from dictionaries, lists, NumPy arrays, or imported from external files such as CSV or Excel. Once data is loaded, you can **view and explore** it using methods like `head()`, `tail()`, and `describe()`. Data can be **selected by label** or **by position**. These indexing systems make it easy to slice, filter, and reorganize datasets efficiently. -### Problem 1: Create a dataframe from an array +### Problem: Create a dataframe from an array Given the data `force_N` and `time_s` ```python @@ -70,8 +80,6 @@ merged = pd.merge(df_force, df_temp, on="Time_s") # Stack multiple test runs vertically combined = pd.concat([df_run1, df_run2], axis=0) ``` - - https://pandas.pydata.org/docs/user_guide/merging.html #### Creating new columns based on existing ones @@ -90,10 +98,9 @@ air_quality["ratio_paris_antwerp"] = ( ``` https://pandas.pydata.org/docs/getting_started/intro_tutorials/03_subset_data.html - https://pandas.pydata.org/docs/user_guide/reshaping.html -### Problem 1: Create a dataframe from data +### Problem: Create a dataframe from data Given the the file `force_displacement_data.txt`. Use pandas to tabulate the data into a dataframe ```python import pandas as pd @@ -130,6 +137,5 @@ except ImportError: ``` -**Activities & Examples:** -- Load small CSV datasets using `numpy.loadtxt()` and `pandas.read_csv()` +## **Activities & Examples:** - Discuss real ME examples: strain gauge data, thermocouple readings, pressure transducers
\ No newline at end of file |
