You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
IoT-For-Beginners/translations/ml/2-farm/lessons/1-predict-plant-growth/code-notebook/gdd.ipynb

169 lines
7.2 KiB

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# വൃദ്ധി ഡിഗ്രി ദിവസങ്ങൾ\n",
"\n",
"ഈ നോട്ട്‌ബുക്ക് CSV ഫയലിൽ സേവ് ചെയ്ത താപനില ഡാറ്റ ലോഡ് ചെയ്ത് അതിന്റെ വിശകലനം നടത്തുന്നു. താപനിലകൾ വരയ്ക്കുകയും, ഓരോ ദിവസത്തെയും ഏറ്റവും ഉയർന്നതും ഏറ്റവും താഴ്ന്നതുമായ മൂല്യങ്ങൾ കാണിക്കുകയും, GDD കണക്കാക്കുകയും ചെയ്യുന്നു.\n",
"\n",
"ഈ നോട്ട്‌ബുക്ക് ഉപയോഗിക്കാൻ:\n",
"\n",
"* `temperature.csv` ഫയൽ ഈ നോട്ട്‌ബുക്കിന് സമാനമായ ഫോൾഡറിലേക്ക് പകർപ്പുചെയ്യുക\n",
"* മുകളിൽ ഉള്ള **▶︎ Run** ബട്ടൺ ഉപയോഗിച്ച് എല്ലാ സെല്ലുകളും പ്രവർത്തിപ്പിക്കുക. ഇത് തിരഞ്ഞെടുത്ത സെലും പ്രവർത്തിപ്പിച്ച്, തുടർന്ന് അടുത്ത സെലിലേക്ക് മാറും.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"താഴെയുള്ള സെല്ലിൽ, `base_temperature` എന്നതു സസ്യത്തിന്റെ അടിസ്ഥാന താപനിലയ്ക്ക് സജ്ജീകരിക്കുക.\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"base_temperature = 10"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"CSV ഫയൽ ഇപ്പോൾ pandas ഉപയോഗിച്ച് ലോഡ് ചെയ്യേണ്ടതാണ്\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"# Read the temperature CSV file\n",
"df = pd.read_csv('temperature.csv')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"ഇപ്പോൾ താപനില ഒരു ഗ്രാഫ് üzerinde രേഖപ്പെടുത്താൻ കഴിയും.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.figure(figsize=(20, 10))\n",
"plt.plot(df['date'], df['temperature'])\n",
"plt.xticks(rotation='vertical');"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"ഡാറ്റ വായിച്ച് കഴിഞ്ഞാൽ അത് `date` കോളം അനുസരിച്ച് ഗ്രൂപ്പുചെയ്യാൻ കഴിയും, ഓരോ തീയതിക്കും കുറഞ്ഞതും ഏറ്റവും കൂടിയ താപനിലകളും താരതമ്യം ചെയ്യാം.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Convert datetimes to pure dates so we can group by the date\n",
"df['date'] = pd.to_datetime(df['date']).dt.date\n",
"\n",
"# Group the data by date so it can be analyzed by date\n",
"data_by_date = df.groupby('date')\n",
"\n",
"# Get the minimum and maximum temperatures for each date\n",
"min_by_date = data_by_date.min()\n",
"max_by_date = data_by_date.max()\n",
"\n",
"# Join the min and max temperatures into one dataframe and flatten it\n",
"min_max_by_date = min_by_date.join(max_by_date, on='date', lsuffix='_min', rsuffix='_max')\n",
"min_max_by_date = min_max_by_date.reset_index()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"സ്റ്റാൻഡേർഡ് GDD സമവാക്യം ഉപയോഗിച്ച് GDD കണക്കാക്കാം\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def calculate_gdd(row):\n",
" return ((row['temperature_max'] + row['temperature_min']) / 2) - base_temperature\n",
"\n",
"# Calculate the GDD for each row\n",
"min_max_by_date['gdd'] = min_max_by_date.apply (lambda row: calculate_gdd(row), axis=1)\n",
"\n",
"# Print the results\n",
"print(min_max_by_date[['date', 'gdd']].to_string(index=False))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n\n<!-- CO-OP TRANSLATOR DISCLAIMER START -->\n**അസ്വീകാര്യം**: \nഈ രേഖ [കോ-ഓപ് ട്രാൻസ്ലേറ്റർ](https://github.com/Azure/co-op-translator) എന്ന AI ഭാഷാനുഭവ സേവനം ഉപയോഗിച്ച് വിവർത്തനം ചെയ്തതാണ്. ഞങ്ങൾ കൃത്യതയ്ക്ക് പരിശ്രമിക്കുന്നുവെങ്കിലും, സ്വയമേഘം പരിഭാഷകൾ തെറ്റുകൾ അല്ലെങ്കിൽ അകുറക്കുകൾ ഉൾക്കൊള്ളാം എന്നതിൽ ശ്രദ്ധിക്കണം. അതിന്റെ സവിഭാഗ ഭാഷയിലുള്ള യഥാർത്ഥ രേഖ എപ്പോഴും പ്രാമാണിക ഉറവിടമായി പഠിക്കണമെന്നും വിലപ്പെട്ട വിവരങ്ങൾക്ക് വിദഗ്ധ മാനവ ഭാഷാന്തരം നിർദ്ദേശിക്കപ്പെടുന്നതുമായി. ഈ വിവർത്തനത്തിന്റെ ഉപയോഗത്തിൽ നിന്നുണ്ടാകുന്ന ഓർമ്മച്ചോദ്യങ്ങൾക്കോ തെറ്റായ വ്യാഖ്യാനങ്ങൾക്ക് ഞങ്ങൾ ഉത്തരവാദിത്വം ഏറ്റെടുക്കുന്നില്ല.\n<!-- CO-OP TRANSLATOR DISCLAIMER END -->\n"
]
}
],
"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.9.1"
},
"metadata": {
"interpreter": {
"hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
}
},
"coopTranslator": {
"original_hash": "8fcf954f6042f0bf3601a2c836a09574",
"translation_date": "2026-01-07T07:19:22+00:00",
"source_file": "2-farm/lessons/1-predict-plant-growth/code-notebook/gdd.ipynb",
"language_code": "ml"
}
},
"nbformat": 4,
"nbformat_minor": 2
}