Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
RamiyapriyaS authored Nov 21, 2024
1 parent eb5522b commit c0f3a57
Showing 1 changed file with 133 additions and 0 deletions.
133 changes: 133 additions & 0 deletions notebooks/GenAI/example_scripts/quick-actions-testing.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "bed9c0c9-4756-4161-b4be-e32ce3a58bff",
"metadata": {},
"outputs": [],
"source": [
"#Cell 1\n",
"#import libraries\n",
"\n",
"import pandas as pd\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "64f8d006-28f3-4d83-ae3a-9e23cccff5d7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" Gene Expression_Level Sample_ID Condition\n",
"0 GeneA 12.5 S1 Control\n",
"1 GeneB 8.3 S2 Treated\n",
"2 GeneC 15.2 S3 Control\n",
"3 GeneD 7.8 S4 Treated\n"
]
}
],
"source": [
"#Cell 2\n",
"\n",
"# Initialize data of lists\n",
"data = {\n",
" 'Gene': ['GeneA', 'GeneB', 'GeneC', 'GeneD'],\n",
" 'Expression_Level': [12.5, 8.3, 15.2, 7.8],\n",
" 'Sample_ID': ['S1', 'S2', 'S3', 'S4'],\n",
" 'Condition': ['Control', 'Treated', 'Control', 'Treated']\n",
"}\n",
"\n",
"# Create DataFrame\n",
"df = pd.DataFrame(data)\n",
"\n",
"# Display the DataFrame\n",
"print(df)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "8ca19300-1635-4a8a-9ef8-f9554bc1baac",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'describe' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[5], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# View summary statistics\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[43mdescribe\u001b[49m()\u001b[38;5;241m.\u001b[39mdf\n",
"\u001b[0;31mNameError\u001b[0m: name 'describe' is not defined"
]
}
],
"source": [
"#Cell 3\n",
"\n",
"# Error debugging test /fix\n",
"# View summary statistics\n",
"describe().df"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "550a402e-66bd-4890-a063-e3d82679c0a8",
"metadata": {},
"outputs": [],
"source": [
"#Cell 4\n",
"\n",
"# Optimize selection test /optimize\n",
"# Add additional data to the dataframe\n",
"df['Sample_Type'] = ['Tissue1', 'Tissue2', 'Tissue1', 'Tissue2']\n",
"df['P_Value'] = [0.05, 0.01, 0.03, 0.07]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0d45c1aa-2075-4c8a-9ecc-94fb03a71f78",
"metadata": {},
"outputs": [],
"source": [
"#Cell 5\n",
"\n",
"#Explain selection test /explain\n",
"#Plot results\n",
"import matplotlib.pyplot as plt\n",
"\n",
"df.plot(x='Sample_ID', y='Expression_Level', kind='line')\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit c0f3a57

Please sign in to comment.