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.
169 lines
7.2 KiB
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": [
|
|
"வெப்பநிலை இப்போது ஒரு வரைபடத்தில் வரைபடமாக்கலாம்.\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\n**அறிவிப்பு**: \nஇந்த ஆவணம் [Co-op Translator](https://github.com/Azure/co-op-translator) என்ற AI மொழிபெயர்ப்பு சேவையைப் பயன்படுத்தி மொழிபெயர்க்கப்பட்டுள்ளது. நாங்கள் துல்லியத்திற்காக முயற்சிக்கிறோம், ஆனால் தானியங்கி மொழிபெயர்ப்புகளில் பிழைகள் அல்லது தவறுகள் இருக்கக்கூடும் என்பதை கவனத்தில் கொள்ளவும். அதன் சொந்த மொழியில் உள்ள மூல ஆவணம் அதிகாரப்பூர்வ ஆதாரமாக கருதப்பட வேண்டும். முக்கியமான தகவல்களுக்கு, தொழில்முறை மனித மொழிபெயர்ப்பு பரிந்துரைக்கப்படுகிறது. இந்த மொழிபெயர்ப்பைப் பயன்படுத்துவதால் ஏற்படும் எந்த தவறான புரிதல்களுக்கும் அல்லது தவறான விளக்கங்களுக்கும் நாங்கள் பொறுப்பல்ல.\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": "2025-10-11T12:53:26+00:00",
|
|
"source_file": "2-farm/lessons/1-predict-plant-growth/code-notebook/gdd.ipynb",
|
|
"language_code": "ta"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
} |