parent
a6aa8150a5
commit
665f808cc5
@ -0,0 +1,165 @@
|
||||
{
|
||||
"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": []
|
||||
},
|
||||
{
|
||||
"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": []
|
||||
},
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
],
|
||||
"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-08-26T13:49:05+00:00",
|
||||
"source_file": "2-farm/lessons/1-predict-plant-growth/code-notebook/gdd.ipynb",
|
||||
"language_code": "hi"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Giorni di Crescita Termica\n",
|
||||
"\n",
|
||||
"Questo notebook carica i dati di temperatura salvati in un file CSV e li analizza. Traccia i grafici delle temperature, mostra il valore massimo e minimo per ogni giorno e calcola i GDD.\n",
|
||||
"\n",
|
||||
"Per utilizzare questo notebook:\n",
|
||||
"\n",
|
||||
"* Copia il file `temperature.csv` nella stessa cartella di questo notebook\n",
|
||||
"* Esegui tutte le celle utilizzando il pulsante **▶︎ Run** sopra. Questo eseguirà la cella selezionata e passerà alla successiva.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Nella cella sottostante, imposta `base_temperature` alla temperatura base della pianta.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"base_temperature = 10"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Il file CSV ora deve essere caricato, utilizzando 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": []
|
||||
},
|
||||
{
|
||||
"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": [
|
||||
"Una volta che i dati sono stati letti, possono essere raggruppati per la colonna `date`, e le temperature minima e massima estratte per ogni data.\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": []
|
||||
},
|
||||
{
|
||||
"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**Disclaimer**: \nQuesto documento è stato tradotto utilizzando il servizio di traduzione automatica [Co-op Translator](https://github.com/Azure/co-op-translator). Sebbene ci impegniamo per garantire l'accuratezza, si prega di notare che le traduzioni automatiche possono contenere errori o imprecisioni. Il documento originale nella sua lingua nativa dovrebbe essere considerato la fonte autorevole. Per informazioni critiche, si raccomanda una traduzione professionale effettuata da un traduttore umano. Non siamo responsabili per eventuali incomprensioni o interpretazioni errate derivanti dall'uso di questa traduzione.\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-08-26T13:49:19+00:00",
|
||||
"source_file": "2-farm/lessons/1-predict-plant-growth/code-notebook/gdd.ipynb",
|
||||
"language_code": "it"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
@ -0,0 +1,167 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Dni Wegetacyjne (GDD)\n",
|
||||
"\n",
|
||||
"Ten notatnik ładuje dane dotyczące temperatury zapisane w pliku CSV i analizuje je. Tworzy wykresy temperatur, pokazuje najwyższą i najniższą wartość dla każdego dnia oraz oblicza GDD.\n",
|
||||
"\n",
|
||||
"Aby skorzystać z tego notatnika:\n",
|
||||
"\n",
|
||||
"* Skopiuj plik `temperature.csv` do tego samego folderu, co ten notatnik\n",
|
||||
"* Uruchom wszystkie komórki, korzystając z przycisku **▶︎ Run** powyżej. Spowoduje to uruchomienie wybranej komórki, a następnie przejście do kolejnej.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"W poniższej komórce ustaw `base_temperature` na podstawową temperaturę rośliny.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"base_temperature = 10"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Plik CSV musi teraz zostać załadowany za pomocą 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": []
|
||||
},
|
||||
{
|
||||
"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": [
|
||||
"Gdy dane zostaną odczytane, można je pogrupować według kolumny `date`, a minimalne i maksymalne temperatury wyodrębnić dla każdej daty.\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 można obliczyć za pomocą standardowego równania 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**Zastrzeżenie**: \nTen dokument został przetłumaczony za pomocą usługi tłumaczenia AI [Co-op Translator](https://github.com/Azure/co-op-translator). Chociaż dokładamy wszelkich starań, aby tłumaczenie było precyzyjne, prosimy pamiętać, że automatyczne tłumaczenia mogą zawierać błędy lub nieścisłości. Oryginalny dokument w jego rodzimym języku powinien być uznawany za źródło autorytatywne. W przypadku informacji krytycznych zaleca się skorzystanie z profesjonalnego tłumaczenia przez człowieka. Nie ponosimy odpowiedzialności za jakiekolwiek nieporozumienia lub błędne interpretacje wynikające z użycia tego tłumaczenia.\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-08-26T13:48:53+00:00",
|
||||
"source_file": "2-farm/lessons/1-predict-plant-growth/code-notebook/gdd.ipynb",
|
||||
"language_code": "pl"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
Loading…
Reference in new issue