Skip to content

Commit

Permalink
Merge pull request #90 from potenday-project/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
dongseoki authored Dec 24, 2023
2 parents d28c8dd + 1cd08f1 commit f7fbb5a
Show file tree
Hide file tree
Showing 52 changed files with 2,882 additions and 198 deletions.
95 changes: 95 additions & 0 deletions crawling/avg.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"def average_decimal_from_percentage_range(percentage_range):\n",
" # Split the range into lower and upper bounds\n",
" lower, upper = map(float, percentage_range.strip('%').split('~'))\n",
"\n",
" # Calculate the average\n",
" average_decimal = (lower + upper) / 2\n",
"\n",
" return average_decimal\n",
"\n",
"# Test the function\n",
"percentage_range_1 = \"14~15%\"\n",
"percentage_range_2 = \"16.5~18.6%\"\n",
"\n",
"average_decimal_1 = average_decimal_from_percentage_range(percentage_range_1)\n",
"average_decimal_2 = average_decimal_from_percentage_range(percentage_range_2)\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"14.5"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"average_decimal_1\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"17.55"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"average_decimal_2"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit f7fbb5a

Please sign in to comment.