{ "cells": [ { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import pickle" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [], "source": [ "# Read the excel file\n", "doe_df = pd.read_excel(\n", " \"data/NiTi_Cubes_Analysis.xlsx\",\n", " sheet_name=\"DOE & RSPNS\",\n", " header=1,\n", " usecols=\"A:M, T:AC\",\n", " nrows=81,\n", ")\n", "# Remove newlines from column names\n", "doe_df.rename(\n", " mapper=dict(zip(doe_df.keys(), (k.replace(\"\\n\", \" \") for k in doe_df.keys()))),\n", " axis=1,\n", " inplace=True,\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "doe_df" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [], "source": [ "# Split the dataframe into a dictionary of dataframes, one for each sample\n", "sample_y = dict(iter(doe_df.groupby(\"Sample\")))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sample_y[1]" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [], "source": [ "# Finally, pickle this data for use in experiments\n", "with open(\"sample_y.pkl\", \"wb\") as f:\n", " pickle.dump(sample_y, f)" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | Sample | \n", "Laser power, P\\n(W) | \n", "Scan speed, V\\n(mm/sec) | \n", "Spot size, F\\n(µm) | \n", "Hatch spacing, H\\n(µm) | \n", "Surface Energy Density @ 90µm Layer thickness, El (J/mm2) | \n", "Surface Energy Density @ Spot size, EF (J/mm2) | \n", "Vol. Energy Density @ Hatch Spacing, VEDH (J/mm3) | \n", "Vol. Energy Density @ Spot Size, VEDF (J/mm3) | \n", "Density\\n(Archimedes by Acetone) | \n", "... | \n", "Ni | \n", "Ti | \n", "Oxygen | \n", "Carbon | \n", "Ni (Norm) | \n", "Ti (Norm) | \n", "Sa (um) | \n", "Sku | \n", "Ssk | \n", "Sz (um) | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "1 | \n", "180 | \n", "1000 | \n", "40 | \n", "40 | \n", "2.0 | \n", "4.5 | \n", "50.0 | \n", "50.0 | \n", "6.343695 | \n", "... | \n", "41.33 | \n", "43.76 | \n", "1.1 | \n", "13.81 | \n", "48.5721 | \n", "51.4279 | \n", "18.686 | \n", "3.243 | \n", "0.28 | \n", "187.116 | \n", "
1 rows × 23 columns
\n", "