{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# ಗ್ರೋಯಿಂಗ್ ಡಿಗ್ರಿ ಡೇಸ್\n", "\n", "ಈ ನೋಟ್‌ಬುಕ್ CSV ಫೈಲ್‌ನಲ್ಲಿ ಉಳಿಸಲಾಗಿರುವ ತಾಪಮಾನ ಡೇಟಾವನ್ನು لوಡ್ಮಾಡುತ್ತಾ, ಅದನ್ನು ವಿಶ್ಲೇಷಿಸುತ್ತದೆ. ಇದು ತಾಪಮಾನಗಳನ್ನು ಪ್ಲಾಟ್ ಮಾಡುತ್ತದೆ, ಪ್ರತಿದಿನದ ಅತ್ಯಧಿಕ ಮತ್ತು ಕನಿಷ್ಠ ಮೌಲ್ಯವನ್ನು ತೋರಿಸುತ್ತದೆ ಮತ್ತು GDD ಅನ್ನು ಲೆಕ್ಕ ಹಾಕುತ್ತದೆ.\n", "\n", "ಈ ನೋಟ್‌ಬುಕ್ ಅನ್ನು ಬಳಸಲು:\n", "\n", "* `temperature.csv` ಫೈಲ್ ಅನ್ನು ಈ ನೋಟ್‌ಬುಕ್ ಇರುವ ಫೋಲ್ಡರ್‌ಗೆ ನಕಲಿಸಿಕೊಳ್ಳಿ\n", "* ಮೇಲಿನ **▶︎ ರನ್** ಬಟನ್ ಬಳಸಿ ಎಲ್ಲ ಸೆಲ್‌ಗಳನ್ನು ರನ್ ಮಾಡಿ. ಇದರಿಂದ ಆಯ್ದ ಸೆಲ್ ರನ್ ಆಗಿ, ನಂತರ ಮುಂದಿನ ಸೆಲ್‌ಗೆ ಸಾಗುತ್ತದೆ.\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ಈ ದಸ್ತಾವೇಜನ್ನು AI ಅನುವಾದ ಸೇವೆ [Co-op Translator](https://github.com/Azure/co-op-translator) ಬಳಸಿ ಅನುವಾದಿಸಲಾಗಿದೆ. ನಾವು درستತೆಗಾಗಿ ಶ್ರಮಿಸುತ್ತಿದ್ದರೂ, ಸ್ವಯಂಕ್ರಿಯ ಅನುವಾದಗಳಲ್ಲಿ ತಪ್ಪುಗಳು ಅಥವಾ ಅಸತ್ಯತೆಗೆ ಸಾಧ್ಯತೆ ಇರುವದನ್ನು ಗಮನಿಸಿದೆ. ಮೂಲ ಭಾಷೆಯಲ್ಲಿ ಇರುವ ಮೂಲ ದಸ್ತಾವೇಜನ್ನು ಅಧಿಕೃತ ಮತ್ತು ನಂಬಿಕೆಯಾಗುವ ಮೂಲ ಎಂದು ಪರಿಗಣಿಸಿಕೊಳ್ಳಿ. ಪ್ರಮುಖ ಮಾಹಿತಿಗಾಗಿ ವೃತ್ತಿಪರ ಮಾನವ ಅನುವಾದವನ್ನು ಶಿಫಾರಸು ಮಾಡಲಾಗುತ್ತದೆ. ಈ ಅನುವಾದ ಬಳಕೆಯಿಂದ ಉದ್ಭವಿಸಬಹುದಾದ ಯಾವುದೇ ತಪ್ಪಿತಸ್ಥತೆಗಳು ಅಥವಾ ತಪ್ಪರ್ಥಗಳನ್ನು ನಾವು ಹೊಣೆ ಹೊತ್ತಿಲ್ಲ.\n\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:36+00:00", "source_file": "2-farm/lessons/1-predict-plant-growth/code-notebook/gdd.ipynb", "language_code": "kn" } }, "nbformat": 4, "nbformat_minor": 2 }