Skip to content

Commit

Permalink
Merge pull request rohitinu6#119 from Maryam0330/main
Browse files Browse the repository at this point in the history
Updated Stock_prediction_Data_Analysis.ipynb
  • Loading branch information
Mayureshd-18 authored Oct 16, 2024
2 parents c4481a4 + 38dd51f commit 60f9199
Showing 1 changed file with 262 additions and 2 deletions.
264 changes: 262 additions & 2 deletions Stock_prediction_Data_Analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,228 @@
"df.head(10)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "eec26960",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Date</th>\n",
" <th>Open</th>\n",
" <th>High</th>\n",
" <th>Low</th>\n",
" <th>Close</th>\n",
" <th>Adj Close</th>\n",
" <th>Volume</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>7064</th>\n",
" <td>29-01-2024</td>\n",
" <td>619.000000</td>\n",
" <td>629.500000</td>\n",
" <td>615.599976</td>\n",
" <td>622.950012</td>\n",
" <td>622.950012</td>\n",
" <td>19572140.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7065</th>\n",
" <td>30-01-2024</td>\n",
" <td>625.450012</td>\n",
" <td>633.500000</td>\n",
" <td>624.200012</td>\n",
" <td>626.750000</td>\n",
" <td>626.750000</td>\n",
" <td>16966577.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7066</th>\n",
" <td>31-01-2024</td>\n",
" <td>626.400024</td>\n",
" <td>643.200012</td>\n",
" <td>622.000000</td>\n",
" <td>640.500000</td>\n",
" <td>640.500000</td>\n",
" <td>23270745.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7067</th>\n",
" <td>01-02-2024</td>\n",
" <td>642.750000</td>\n",
" <td>652.950012</td>\n",
" <td>633.250000</td>\n",
" <td>647.650024</td>\n",
" <td>647.650024</td>\n",
" <td>26587707.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7068</th>\n",
" <td>02-02-2024</td>\n",
" <td>652.000000</td>\n",
" <td>660.549988</td>\n",
" <td>646.700012</td>\n",
" <td>649.650024</td>\n",
" <td>649.650024</td>\n",
" <td>27471811.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7069</th>\n",
" <td>05-02-2024</td>\n",
" <td>647.099976</td>\n",
" <td>654.799988</td>\n",
" <td>638.750000</td>\n",
" <td>642.950012</td>\n",
" <td>642.950012</td>\n",
" <td>28339525.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7070</th>\n",
" <td>06-02-2024</td>\n",
" <td>644.450012</td>\n",
" <td>655.000000</td>\n",
" <td>637.700012</td>\n",
" <td>650.250000</td>\n",
" <td>650.250000</td>\n",
" <td>14079390.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7071</th>\n",
" <td>07-02-2024</td>\n",
" <td>655.049988</td>\n",
" <td>677.950012</td>\n",
" <td>655.000000</td>\n",
" <td>675.250000</td>\n",
" <td>675.250000</td>\n",
" <td>41696232.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7072</th>\n",
" <td>08-02-2024</td>\n",
" <td>680.400024</td>\n",
" <td>718.900024</td>\n",
" <td>678.500000</td>\n",
" <td>699.549988</td>\n",
" <td>699.549988</td>\n",
" <td>74222434.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7073</th>\n",
" <td>09-02-2024</td>\n",
" <td>703.650024</td>\n",
" <td>728.349976</td>\n",
" <td>694.200012</td>\n",
" <td>725.250000</td>\n",
" <td>725.250000</td>\n",
" <td>43235061.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Date Open High Low Close Adj Close \\\n",
"7064 29-01-2024 619.000000 629.500000 615.599976 622.950012 622.950012 \n",
"7065 30-01-2024 625.450012 633.500000 624.200012 626.750000 626.750000 \n",
"7066 31-01-2024 626.400024 643.200012 622.000000 640.500000 640.500000 \n",
"7067 01-02-2024 642.750000 652.950012 633.250000 647.650024 647.650024 \n",
"7068 02-02-2024 652.000000 660.549988 646.700012 649.650024 649.650024 \n",
"7069 05-02-2024 647.099976 654.799988 638.750000 642.950012 642.950012 \n",
"7070 06-02-2024 644.450012 655.000000 637.700012 650.250000 650.250000 \n",
"7071 07-02-2024 655.049988 677.950012 655.000000 675.250000 675.250000 \n",
"7072 08-02-2024 680.400024 718.900024 678.500000 699.549988 699.549988 \n",
"7073 09-02-2024 703.650024 728.349976 694.200012 725.250000 725.250000 \n",
"\n",
" Volume \n",
"7064 19572140.0 \n",
"7065 16966577.0 \n",
"7066 23270745.0 \n",
"7067 26587707.0 \n",
"7068 27471811.0 \n",
"7069 28339525.0 \n",
"7070 14079390.0 \n",
"7071 41696232.0 \n",
"7072 74222434.0 \n",
"7073 43235061.0 "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Display the last 10 rows of the DataFrame\n",
"df.tail(10)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "23974fec",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Columns: Index(['Date', 'Open', 'High', 'Low', 'Close', 'Adj Close', 'Volume'], dtype='object')\n"
]
}
],
"source": [
"# Display the columns in the DataFrame\n",
"print(\"Columns:\", df.columns)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "538be913",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Types: Date object\n",
"Open float64\n",
"High float64\n",
"Low float64\n",
"Close float64\n",
"Adj Close float64\n",
"Volume float64\n",
"dtype: object\n"
]
}
],
"source": [
"# Display the data types of each column\n",
"print(\"Data Types:\", df.dtypes)"
]
},
{
"cell_type": "code",
"execution_count": 4,
Expand All @@ -218,6 +440,44 @@
"df.shape"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "ce71bbd5",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Size of DataFrame: 49518\n"
]
}
],
"source": [
"# Display the size of the DataFrame\n",
"print(\"Size of DataFrame:\", df.size)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "5ffbb9a3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Numeric Columns: Index(['Open', 'High', 'Low', 'Close', 'Adj Close', 'Volume'], dtype='object')\n"
]
}
],
"source": [
"# Display numeric columns in the DataFrame\n",
"print(\"Numeric Columns:\", df.select_dtypes(include=[np.number]).columns)"
]
},
{
"cell_type": "code",
"execution_count": 5,
Expand Down Expand Up @@ -1057,7 +1317,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -1071,7 +1331,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 60f9199

Please sign in to comment.