diff options
Diffstat (limited to 'tutorials/module_4/1_importing_scientific_data.md')
| -rw-r--r-- | tutorials/module_4/1_importing_scientific_data.md | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tutorials/module_4/1_importing_scientific_data.md b/tutorials/module_4/1_importing_scientific_data.md new file mode 100644 index 0000000..b51558b --- /dev/null +++ b/tutorials/module_4/1_importing_scientific_data.md @@ -0,0 +1,40 @@ +# Importing Scientific Data using Pandas + +^8eb966 + +[Introduction text] + + +Pandas is a library that is built on top of NumPy and is there for customarily to import both when working with Pandas. + +```python +import numpy as np +import pandas as pd +``` + + +DataFrame + +A `DataFrame` in pandas is a two-dimensional data structure like table with rows and columns. + + + +```python +# Tensile test data +data = { + "Force (N)": [10, 15, 20, 25], + "Displacement (mm)": [1.2, 1.8, 2.5, 3.0], + "Stress (MPa)": [2.6, 3.9, 5.2, 6.5], +} +``` + + + +Object Creation + +```python +# Create DataFrame with row labels +df = pd.DataFrame(data, index=["Test1", "Test2", "Test3", "Test4"]) + +print(df) +```
\ No newline at end of file |
