{ "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", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SampleLaser power, P\\n(W)Scan speed, V\\n(mm/sec)Spot size, F\\n(µm)Hatch spacing, H\\n(µm)Surface Energy Density @ 90µm Layer thickness, El (J/mm2)Surface Energy Density @ Spot size, EF (J/mm2)Vol. Energy Density @ Hatch Spacing, VEDH (J/mm3)Vol. Energy Density @ Spot Size, VEDF (J/mm3)Density\\n(Archimedes by Acetone)...NiTiOxygenCarbonNi (Norm)Ti (Norm)Sa (um)SkuSskSz (um)
01180100040402.04.550.050.06.343695...41.3343.761.113.8148.572151.427918.6863.2430.28187.116
\n", "

1 rows × 23 columns

\n", "
" ], "text/plain": [ " Sample Laser power, P\\n(W) Scan speed, V\\n(mm/sec) Spot size, F\\n(µm) \\\n", "0 1 180 1000 40 \n", "\n", " Hatch spacing, H\\n(µm) \\\n", "0 40 \n", "\n", " Surface Energy Density @ 90µm Layer thickness, El (J/mm2) \\\n", "0 2.0 \n", "\n", " Surface Energy Density @ Spot size, EF (J/mm2) \\\n", "0 4.5 \n", "\n", " Vol. Energy Density @ Hatch Spacing, VEDH (J/mm3) \\\n", "0 50.0 \n", "\n", " Vol. Energy Density @ Spot Size, VEDF (J/mm3) \\\n", "0 50.0 \n", "\n", " Density\\n(Archimedes by Acetone) ... Ni Ti Oxygen Carbon \\\n", "0 6.343695 ... 41.33 43.76 1.1 13.81 \n", "\n", " Ni (Norm) Ti (Norm) Sa (um) Sku Ssk Sz (um) \n", "0 48.5721 51.4279 18.686 3.243 0.28 187.116 \n", "\n", "[1 rows x 23 columns]" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sample_y[1]" ] } ], "metadata": { "kernelspec": { "display_name": ".venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.3" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }