Azarthehulk
commited on
Commit
•
f3a8183
1
Parent(s):
ff31eaf
Upload pandas_basic.ipynb
Browse filesusing some of the basic pandas functions_and usefull for the very beginig when started practice on the datasets using python laibraries
- pandas_basic.ipynb +788 -0
pandas_basic.ipynb
ADDED
@@ -0,0 +1,788 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"id": "9afe08a5",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [],
|
9 |
+
"source": [
|
10 |
+
"import pandas as pd"
|
11 |
+
]
|
12 |
+
},
|
13 |
+
{
|
14 |
+
"cell_type": "code",
|
15 |
+
"execution_count": 2,
|
16 |
+
"id": "c5856fa5",
|
17 |
+
"metadata": {},
|
18 |
+
"outputs": [
|
19 |
+
{
|
20 |
+
"ename": "TypeError",
|
21 |
+
"evalue": "Index(...) must be called with a collection of some kind, 2 was passed",
|
22 |
+
"output_type": "error",
|
23 |
+
"traceback": [
|
24 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
25 |
+
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
|
26 |
+
"Input \u001b[0;32mIn [2]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m df\u001b[38;5;241m=\u001b[39m\u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mSeries\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m3\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m4\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m5\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28mprint\u001b[39m(df)\n",
|
27 |
+
"File \u001b[0;32m/opt/anaconda3/lib/python3.9/site-packages/pandas/core/series.py:380\u001b[0m, in \u001b[0;36mSeries.__init__\u001b[0;34m(self, data, index, dtype, name, copy, fastpath)\u001b[0m\n\u001b[1;32m 376\u001b[0m \u001b[38;5;66;03m# uncomment the line below when removing the FutureWarning\u001b[39;00m\n\u001b[1;32m 377\u001b[0m \u001b[38;5;66;03m# dtype = np.dtype(object)\u001b[39;00m\n\u001b[1;32m 379\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m index \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 380\u001b[0m index \u001b[38;5;241m=\u001b[39m \u001b[43mensure_index\u001b[49m\u001b[43m(\u001b[49m\u001b[43mindex\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 382\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m data \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 383\u001b[0m data \u001b[38;5;241m=\u001b[39m {}\n",
|
28 |
+
"File \u001b[0;32m/opt/anaconda3/lib/python3.9/site-packages/pandas/core/indexes/base.py:7043\u001b[0m, in \u001b[0;36mensure_index\u001b[0;34m(index_like, copy)\u001b[0m\n\u001b[1;32m 7041\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m Index\u001b[38;5;241m.\u001b[39m_with_infer(index_like, copy\u001b[38;5;241m=\u001b[39mcopy, tupleize_cols\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m)\n\u001b[1;32m 7042\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 7043\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mIndex\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_with_infer\u001b[49m\u001b[43m(\u001b[49m\u001b[43mindex_like\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcopy\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcopy\u001b[49m\u001b[43m)\u001b[49m\n",
|
29 |
+
"File \u001b[0;32m/opt/anaconda3/lib/python3.9/site-packages/pandas/core/indexes/base.py:680\u001b[0m, in \u001b[0;36mIndex._with_infer\u001b[0;34m(cls, *args, **kwargs)\u001b[0m\n\u001b[1;32m 678\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m warnings\u001b[38;5;241m.\u001b[39mcatch_warnings():\n\u001b[1;32m 679\u001b[0m warnings\u001b[38;5;241m.\u001b[39mfilterwarnings(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mignore\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m.*the Index constructor\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;167;01mFutureWarning\u001b[39;00m)\n\u001b[0;32m--> 680\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mcls\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 682\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m result\u001b[38;5;241m.\u001b[39mdtype \u001b[38;5;241m==\u001b[39m _dtype_obj \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m result\u001b[38;5;241m.\u001b[39m_is_multi:\n\u001b[1;32m 683\u001b[0m \u001b[38;5;66;03m# error: Argument 1 to \"maybe_convert_objects\" has incompatible type\u001b[39;00m\n\u001b[1;32m 684\u001b[0m \u001b[38;5;66;03m# \"Union[ExtensionArray, ndarray[Any, Any]]\"; expected\u001b[39;00m\n\u001b[1;32m 685\u001b[0m \u001b[38;5;66;03m# \"ndarray[Any, Any]\"\u001b[39;00m\n\u001b[1;32m 686\u001b[0m values \u001b[38;5;241m=\u001b[39m lib\u001b[38;5;241m.\u001b[39mmaybe_convert_objects(result\u001b[38;5;241m.\u001b[39m_values) \u001b[38;5;66;03m# type: ignore[arg-type]\u001b[39;00m\n",
|
30 |
+
"File \u001b[0;32m/opt/anaconda3/lib/python3.9/site-packages/pandas/core/indexes/base.py:508\u001b[0m, in \u001b[0;36mIndex.__new__\u001b[0;34m(cls, data, dtype, copy, name, tupleize_cols, **kwargs)\u001b[0m\n\u001b[1;32m 505\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m klass\u001b[38;5;241m.\u001b[39m_simple_new(arr, name)\n\u001b[1;32m 507\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m is_scalar(data):\n\u001b[0;32m--> 508\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m.\u001b[39m_scalar_data_error(data)\n\u001b[1;32m 509\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(data, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m__array__\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 510\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m Index(np\u001b[38;5;241m.\u001b[39masarray(data), dtype\u001b[38;5;241m=\u001b[39mdtype, copy\u001b[38;5;241m=\u001b[39mcopy, name\u001b[38;5;241m=\u001b[39mname, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
|
31 |
+
"\u001b[0;31mTypeError\u001b[0m: Index(...) must be called with a collection of some kind, 2 was passed"
|
32 |
+
]
|
33 |
+
}
|
34 |
+
],
|
35 |
+
"source": [
|
36 |
+
"df=pd.Series(1,2,3,4,5)\n",
|
37 |
+
"print(df)"
|
38 |
+
]
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"cell_type": "code",
|
42 |
+
"execution_count": 1,
|
43 |
+
"id": "422aaa0b",
|
44 |
+
"metadata": {},
|
45 |
+
"outputs": [
|
46 |
+
{
|
47 |
+
"ename": "NameError",
|
48 |
+
"evalue": "name 'pd' is not defined",
|
49 |
+
"output_type": "error",
|
50 |
+
"traceback": [
|
51 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
52 |
+
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
|
53 |
+
"Input \u001b[0;32mIn [1]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m dataset\u001b[38;5;241m=\u001b[39m\u001b[43mpd\u001b[49m\u001b[38;5;241m.\u001b[39mread_csv(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mAdvertising.csv\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
|
54 |
+
"\u001b[0;31mNameError\u001b[0m: name 'pd' is not defined"
|
55 |
+
]
|
56 |
+
}
|
57 |
+
],
|
58 |
+
"source": [
|
59 |
+
"dataset=pd.read_csv('Advertising.csv')"
|
60 |
+
]
|
61 |
+
},
|
62 |
+
{
|
63 |
+
"cell_type": "code",
|
64 |
+
"execution_count": 2,
|
65 |
+
"id": "6b4ba291",
|
66 |
+
"metadata": {},
|
67 |
+
"outputs": [],
|
68 |
+
"source": [
|
69 |
+
"import pandas as pd\n",
|
70 |
+
"dataset=pd.read_csv('Advertising.csv')"
|
71 |
+
]
|
72 |
+
},
|
73 |
+
{
|
74 |
+
"cell_type": "code",
|
75 |
+
"execution_count": 3,
|
76 |
+
"id": "2ec925f7",
|
77 |
+
"metadata": {},
|
78 |
+
"outputs": [
|
79 |
+
{
|
80 |
+
"name": "stdout",
|
81 |
+
"output_type": "stream",
|
82 |
+
"text": [
|
83 |
+
" Unnamed: 0 TV radio newspaper sales\n",
|
84 |
+
"0 1 230.1 37.8 69.2 22.1\n",
|
85 |
+
"1 2 44.5 39.3 45.1 10.4\n",
|
86 |
+
"2 3 17.2 45.9 69.3 9.3\n",
|
87 |
+
"3 4 151.5 41.3 58.5 18.5\n",
|
88 |
+
"4 5 180.8 10.8 58.4 12.9\n"
|
89 |
+
]
|
90 |
+
}
|
91 |
+
],
|
92 |
+
"source": [
|
93 |
+
"print(dataset.head())"
|
94 |
+
]
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"cell_type": "code",
|
98 |
+
"execution_count": 4,
|
99 |
+
"id": "4d33fa27",
|
100 |
+
"metadata": {},
|
101 |
+
"outputs": [
|
102 |
+
{
|
103 |
+
"name": "stdout",
|
104 |
+
"output_type": "stream",
|
105 |
+
"text": [
|
106 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
107 |
+
"RangeIndex: 200 entries, 0 to 199\n",
|
108 |
+
"Data columns (total 5 columns):\n",
|
109 |
+
" # Column Non-Null Count Dtype \n",
|
110 |
+
"--- ------ -------------- ----- \n",
|
111 |
+
" 0 Unnamed: 0 200 non-null int64 \n",
|
112 |
+
" 1 TV 200 non-null float64\n",
|
113 |
+
" 2 radio 200 non-null float64\n",
|
114 |
+
" 3 newspaper 200 non-null float64\n",
|
115 |
+
" 4 sales 200 non-null float64\n",
|
116 |
+
"dtypes: float64(4), int64(1)\n",
|
117 |
+
"memory usage: 7.9 KB\n",
|
118 |
+
"None\n"
|
119 |
+
]
|
120 |
+
}
|
121 |
+
],
|
122 |
+
"source": [
|
123 |
+
"print(dataset.info())"
|
124 |
+
]
|
125 |
+
},
|
126 |
+
{
|
127 |
+
"cell_type": "code",
|
128 |
+
"execution_count": 6,
|
129 |
+
"id": "d9d1a560",
|
130 |
+
"metadata": {},
|
131 |
+
"outputs": [
|
132 |
+
{
|
133 |
+
"name": "stdout",
|
134 |
+
"output_type": "stream",
|
135 |
+
"text": [
|
136 |
+
" animal_name hair feathers eggs milk airborne aquatic predator \\\n",
|
137 |
+
"0 aardvark 1 0 0 1 0 0 1 \n",
|
138 |
+
"1 antelope 1 0 0 1 0 0 0 \n",
|
139 |
+
"2 bass 0 0 1 0 0 1 1 \n",
|
140 |
+
"3 bear 1 0 0 1 0 0 1 \n",
|
141 |
+
"4 boar 1 0 0 1 0 0 1 \n",
|
142 |
+
"\n",
|
143 |
+
" toothed backbone breathes venomous fins legs tail domestic catsize \\\n",
|
144 |
+
"0 1 1 1 0 0 4 0 0 1 \n",
|
145 |
+
"1 1 1 1 0 0 4 1 0 1 \n",
|
146 |
+
"2 1 1 0 0 1 0 1 0 0 \n",
|
147 |
+
"3 1 1 1 0 0 4 0 0 1 \n",
|
148 |
+
"4 1 1 1 0 0 4 1 0 1 \n",
|
149 |
+
"\n",
|
150 |
+
" class_type \n",
|
151 |
+
"0 1 \n",
|
152 |
+
"1 1 \n",
|
153 |
+
"2 4 \n",
|
154 |
+
"3 1 \n",
|
155 |
+
"4 1 \n"
|
156 |
+
]
|
157 |
+
}
|
158 |
+
],
|
159 |
+
"source": [
|
160 |
+
"dataset2=pd.read_csv('zoo.csv')\n",
|
161 |
+
"print(dataset2.head())"
|
162 |
+
]
|
163 |
+
},
|
164 |
+
{
|
165 |
+
"cell_type": "code",
|
166 |
+
"execution_count": 7,
|
167 |
+
"id": "9a48dde4",
|
168 |
+
"metadata": {},
|
169 |
+
"outputs": [
|
170 |
+
{
|
171 |
+
"name": "stdout",
|
172 |
+
"output_type": "stream",
|
173 |
+
"text": [
|
174 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
175 |
+
"RangeIndex: 101 entries, 0 to 100\n",
|
176 |
+
"Data columns (total 18 columns):\n",
|
177 |
+
" # Column Non-Null Count Dtype \n",
|
178 |
+
"--- ------ -------------- ----- \n",
|
179 |
+
" 0 animal_name 101 non-null object\n",
|
180 |
+
" 1 hair 101 non-null int64 \n",
|
181 |
+
" 2 feathers 101 non-null int64 \n",
|
182 |
+
" 3 eggs 101 non-null int64 \n",
|
183 |
+
" 4 milk 101 non-null int64 \n",
|
184 |
+
" 5 airborne 101 non-null int64 \n",
|
185 |
+
" 6 aquatic 101 non-null int64 \n",
|
186 |
+
" 7 predator 101 non-null int64 \n",
|
187 |
+
" 8 toothed 101 non-null int64 \n",
|
188 |
+
" 9 backbone 101 non-null int64 \n",
|
189 |
+
" 10 breathes 101 non-null int64 \n",
|
190 |
+
" 11 venomous 101 non-null int64 \n",
|
191 |
+
" 12 fins 101 non-null int64 \n",
|
192 |
+
" 13 legs 101 non-null int64 \n",
|
193 |
+
" 14 tail 101 non-null int64 \n",
|
194 |
+
" 15 domestic 101 non-null int64 \n",
|
195 |
+
" 16 catsize 101 non-null int64 \n",
|
196 |
+
" 17 class_type 101 non-null int64 \n",
|
197 |
+
"dtypes: int64(17), object(1)\n",
|
198 |
+
"memory usage: 14.3+ KB\n",
|
199 |
+
"None\n"
|
200 |
+
]
|
201 |
+
}
|
202 |
+
],
|
203 |
+
"source": [
|
204 |
+
"print(dataset2.info())"
|
205 |
+
]
|
206 |
+
},
|
207 |
+
{
|
208 |
+
"cell_type": "code",
|
209 |
+
"execution_count": 8,
|
210 |
+
"id": "a2ba3d6c",
|
211 |
+
"metadata": {},
|
212 |
+
"outputs": [
|
213 |
+
{
|
214 |
+
"name": "stdout",
|
215 |
+
"output_type": "stream",
|
216 |
+
"text": [
|
217 |
+
" Unnamed: 0 TV radio newspaper sales\n",
|
218 |
+
"0 1 230.1 37.8 69.2 22.1\n",
|
219 |
+
"1 2 44.5 39.3 45.1 10.4\n",
|
220 |
+
"2 3 17.2 45.9 69.3 9.3\n",
|
221 |
+
"3 4 151.5 41.3 58.5 18.5\n",
|
222 |
+
"4 5 180.8 10.8 58.4 12.9\n",
|
223 |
+
"5 6 8.7 48.9 75.0 7.2\n",
|
224 |
+
"6 7 57.5 32.8 23.5 11.8\n",
|
225 |
+
"7 8 120.2 19.6 11.6 13.2\n",
|
226 |
+
"8 9 8.6 2.1 1.0 4.8\n",
|
227 |
+
"9 10 199.8 2.6 21.2 10.6\n",
|
228 |
+
"10 11 66.1 5.8 24.2 8.6\n",
|
229 |
+
"11 12 214.7 24.0 4.0 17.4\n",
|
230 |
+
"12 13 23.8 35.1 65.9 9.2\n",
|
231 |
+
"13 14 97.5 7.6 7.2 9.7\n",
|
232 |
+
"14 15 204.1 32.9 46.0 19.0\n",
|
233 |
+
"15 16 195.4 47.7 52.9 22.4\n",
|
234 |
+
"16 17 67.8 36.6 114.0 12.5\n",
|
235 |
+
"17 18 281.4 39.6 55.8 24.4\n",
|
236 |
+
"18 19 69.2 20.5 18.3 11.3\n",
|
237 |
+
"19 20 147.3 23.9 19.1 14.6\n",
|
238 |
+
"20 21 218.4 27.7 53.4 18.0\n",
|
239 |
+
"21 22 237.4 5.1 23.5 12.5\n",
|
240 |
+
"22 23 13.2 15.9 49.6 5.6\n",
|
241 |
+
"23 24 228.3 16.9 26.2 15.5\n",
|
242 |
+
"24 25 62.3 12.6 18.3 9.7\n",
|
243 |
+
"25 26 262.9 3.5 19.5 12.0\n",
|
244 |
+
"26 27 142.9 29.3 12.6 15.0\n",
|
245 |
+
"27 28 240.1 16.7 22.9 15.9\n",
|
246 |
+
"28 29 248.8 27.1 22.9 18.9\n",
|
247 |
+
"29 30 70.6 16.0 40.8 10.5\n",
|
248 |
+
"30 31 292.9 28.3 43.2 21.4\n",
|
249 |
+
"31 32 112.9 17.4 38.6 11.9\n",
|
250 |
+
"32 33 97.2 1.5 30.0 9.6\n",
|
251 |
+
"33 34 265.6 20.0 0.3 17.4\n",
|
252 |
+
"34 35 95.7 1.4 7.4 9.5\n",
|
253 |
+
"35 36 290.7 4.1 8.5 12.8\n",
|
254 |
+
"36 37 266.9 43.8 5.0 25.4\n",
|
255 |
+
"37 38 74.7 49.4 45.7 14.7\n",
|
256 |
+
"38 39 43.1 26.7 35.1 10.1\n",
|
257 |
+
"39 40 228.0 37.7 32.0 21.5\n",
|
258 |
+
"40 41 202.5 22.3 31.6 16.6\n",
|
259 |
+
"41 42 177.0 33.4 38.7 17.1\n",
|
260 |
+
"42 43 293.6 27.7 1.8 20.7\n",
|
261 |
+
"43 44 206.9 8.4 26.4 12.9\n",
|
262 |
+
"44 45 25.1 25.7 43.3 8.5\n",
|
263 |
+
"45 46 175.1 22.5 31.5 14.9\n",
|
264 |
+
"46 47 89.7 9.9 35.7 10.6\n",
|
265 |
+
"47 48 239.9 41.5 18.5 23.2\n",
|
266 |
+
"48 49 227.2 15.8 49.9 14.8\n",
|
267 |
+
"49 50 66.9 11.7 36.8 9.7\n",
|
268 |
+
"50 51 199.8 3.1 34.6 11.4\n",
|
269 |
+
"51 52 100.4 9.6 3.6 10.7\n",
|
270 |
+
"52 53 216.4 41.7 39.6 22.6\n",
|
271 |
+
"53 54 182.6 46.2 58.7 21.2\n",
|
272 |
+
"54 55 262.7 28.8 15.9 20.2\n",
|
273 |
+
"55 56 198.9 49.4 60.0 23.7\n",
|
274 |
+
"56 57 7.3 28.1 41.4 5.5\n",
|
275 |
+
"57 58 136.2 19.2 16.6 13.2\n",
|
276 |
+
"58 59 210.8 49.6 37.7 23.8\n",
|
277 |
+
"59 60 210.7 29.5 9.3 18.4\n",
|
278 |
+
"60 61 53.5 2.0 21.4 8.1\n",
|
279 |
+
"61 62 261.3 42.7 54.7 24.2\n",
|
280 |
+
"62 63 239.3 15.5 27.3 15.7\n",
|
281 |
+
"63 64 102.7 29.6 8.4 14.0\n",
|
282 |
+
"64 65 131.1 42.8 28.9 18.0\n",
|
283 |
+
"65 66 69.0 9.3 0.9 9.3\n",
|
284 |
+
"66 67 31.5 24.6 2.2 9.5\n",
|
285 |
+
"67 68 139.3 14.5 10.2 13.4\n",
|
286 |
+
"68 69 237.4 27.5 11.0 18.9\n",
|
287 |
+
"69 70 216.8 43.9 27.2 22.3\n",
|
288 |
+
"70 71 199.1 30.6 38.7 18.3\n",
|
289 |
+
"71 72 109.8 14.3 31.7 12.4\n",
|
290 |
+
"72 73 26.8 33.0 19.3 8.8\n",
|
291 |
+
"73 74 129.4 5.7 31.3 11.0\n",
|
292 |
+
"74 75 213.4 24.6 13.1 17.0\n",
|
293 |
+
"75 76 16.9 43.7 89.4 8.7\n",
|
294 |
+
"76 77 27.5 1.6 20.7 6.9\n",
|
295 |
+
"77 78 120.5 28.5 14.2 14.2\n",
|
296 |
+
"78 79 5.4 29.9 9.4 5.3\n",
|
297 |
+
"79 80 116.0 7.7 23.1 11.0\n",
|
298 |
+
"80 81 76.4 26.7 22.3 11.8\n",
|
299 |
+
"81 82 239.8 4.1 36.9 12.3\n",
|
300 |
+
"82 83 75.3 20.3 32.5 11.3\n",
|
301 |
+
"83 84 68.4 44.5 35.6 13.6\n",
|
302 |
+
"84 85 213.5 43.0 33.8 21.7\n",
|
303 |
+
"85 86 193.2 18.4 65.7 15.2\n",
|
304 |
+
"86 87 76.3 27.5 16.0 12.0\n",
|
305 |
+
"87 88 110.7 40.6 63.2 16.0\n",
|
306 |
+
"88 89 88.3 25.5 73.4 12.9\n",
|
307 |
+
"89 90 109.8 47.8 51.4 16.7\n",
|
308 |
+
"90 91 134.3 4.9 9.3 11.2\n",
|
309 |
+
"91 92 28.6 1.5 33.0 7.3\n",
|
310 |
+
"92 93 217.7 33.5 59.0 19.4\n",
|
311 |
+
"93 94 250.9 36.5 72.3 22.2\n",
|
312 |
+
"94 95 107.4 14.0 10.9 11.5\n",
|
313 |
+
"95 96 163.3 31.6 52.9 16.9\n",
|
314 |
+
"96 97 197.6 3.5 5.9 11.7\n",
|
315 |
+
"97 98 184.9 21.0 22.0 15.5\n",
|
316 |
+
"98 99 289.7 42.3 51.2 25.4\n",
|
317 |
+
"99 100 135.2 41.7 45.9 17.2\n",
|
318 |
+
"100 101 222.4 4.3 49.8 11.7\n",
|
319 |
+
"101 102 296.4 36.3 100.9 23.8\n",
|
320 |
+
"102 103 280.2 10.1 21.4 14.8\n",
|
321 |
+
"103 104 187.9 17.2 17.9 14.7\n",
|
322 |
+
"104 105 238.2 34.3 5.3 20.7\n",
|
323 |
+
"105 106 137.9 46.4 59.0 19.2\n",
|
324 |
+
"106 107 25.0 11.0 29.7 7.2\n",
|
325 |
+
"107 108 90.4 0.3 23.2 8.7\n",
|
326 |
+
"108 109 13.1 0.4 25.6 5.3\n",
|
327 |
+
"109 110 255.4 26.9 5.5 19.8\n",
|
328 |
+
"110 111 225.8 8.2 56.5 13.4\n",
|
329 |
+
"111 112 241.7 38.0 23.2 21.8\n",
|
330 |
+
"112 113 175.7 15.4 2.4 14.1\n",
|
331 |
+
"113 114 209.6 20.6 10.7 15.9\n",
|
332 |
+
"114 115 78.2 46.8 34.5 14.6\n",
|
333 |
+
"115 116 75.1 35.0 52.7 12.6\n",
|
334 |
+
"116 117 139.2 14.3 25.6 12.2\n",
|
335 |
+
"117 118 76.4 0.8 14.8 9.4\n",
|
336 |
+
"118 119 125.7 36.9 79.2 15.9\n",
|
337 |
+
"119 120 19.4 16.0 22.3 6.6\n",
|
338 |
+
"120 121 141.3 26.8 46.2 15.5\n",
|
339 |
+
"121 122 18.8 21.7 50.4 7.0\n",
|
340 |
+
"122 123 224.0 2.4 15.6 11.6\n",
|
341 |
+
"123 124 123.1 34.6 12.4 15.2\n",
|
342 |
+
"124 125 229.5 32.3 74.2 19.7\n",
|
343 |
+
"125 126 87.2 11.8 25.9 10.6\n",
|
344 |
+
"126 127 7.8 38.9 50.6 6.6\n",
|
345 |
+
"127 128 80.2 0.0 9.2 8.8\n",
|
346 |
+
"128 129 220.3 49.0 3.2 24.7\n",
|
347 |
+
"129 130 59.6 12.0 43.1 9.7\n",
|
348 |
+
"130 131 0.7 39.6 8.7 1.6\n",
|
349 |
+
"131 132 265.2 2.9 43.0 12.7\n",
|
350 |
+
"132 133 8.4 27.2 2.1 5.7\n",
|
351 |
+
"133 134 219.8 33.5 45.1 19.6\n",
|
352 |
+
"134 135 36.9 38.6 65.6 10.8\n",
|
353 |
+
"135 136 48.3 47.0 8.5 11.6\n",
|
354 |
+
"136 137 25.6 39.0 9.3 9.5\n",
|
355 |
+
"137 138 273.7 28.9 59.7 20.8\n",
|
356 |
+
"138 139 43.0 25.9 20.5 9.6\n",
|
357 |
+
"139 140 184.9 43.9 1.7 20.7\n",
|
358 |
+
"140 141 73.4 17.0 12.9 10.9\n",
|
359 |
+
"141 142 193.7 35.4 75.6 19.2\n",
|
360 |
+
"142 143 220.5 33.2 37.9 20.1\n",
|
361 |
+
"143 144 104.6 5.7 34.4 10.4\n",
|
362 |
+
"144 145 96.2 14.8 38.9 11.4\n",
|
363 |
+
"145 146 140.3 1.9 9.0 10.3\n",
|
364 |
+
"146 147 240.1 7.3 8.7 13.2\n",
|
365 |
+
"147 148 243.2 49.0 44.3 25.4\n",
|
366 |
+
"148 149 38.0 40.3 11.9 10.9\n",
|
367 |
+
"149 150 44.7 25.8 20.6 10.1\n",
|
368 |
+
"150 151 280.7 13.9 37.0 16.1\n",
|
369 |
+
"151 152 121.0 8.4 48.7 11.6\n",
|
370 |
+
"152 153 197.6 23.3 14.2 16.6\n",
|
371 |
+
"153 154 171.3 39.7 37.7 19.0\n",
|
372 |
+
"154 155 187.8 21.1 9.5 15.6\n",
|
373 |
+
"155 156 4.1 11.6 5.7 3.2\n",
|
374 |
+
"156 157 93.9 43.5 50.5 15.3\n",
|
375 |
+
"157 158 149.8 1.3 24.3 10.1\n",
|
376 |
+
"158 159 11.7 36.9 45.2 7.3\n",
|
377 |
+
"159 160 131.7 18.4 34.6 12.9\n",
|
378 |
+
"160 161 172.5 18.1 30.7 14.4\n",
|
379 |
+
"161 162 85.7 35.8 49.3 13.3\n",
|
380 |
+
"162 163 188.4 18.1 25.6 14.9\n",
|
381 |
+
"163 164 163.5 36.8 7.4 18.0\n",
|
382 |
+
"164 165 117.2 14.7 5.4 11.9\n",
|
383 |
+
"165 166 234.5 3.4 84.8 11.9\n",
|
384 |
+
"166 167 17.9 37.6 21.6 8.0\n",
|
385 |
+
"167 168 206.8 5.2 19.4 12.2\n",
|
386 |
+
"168 169 215.4 23.6 57.6 17.1\n",
|
387 |
+
"169 170 284.3 10.6 6.4 15.0\n",
|
388 |
+
"170 171 50.0 11.6 18.4 8.4\n",
|
389 |
+
"171 172 164.5 20.9 47.4 14.5\n",
|
390 |
+
"172 173 19.6 20.1 17.0 7.6\n",
|
391 |
+
"173 174 168.4 7.1 12.8 11.7\n",
|
392 |
+
"174 175 222.4 3.4 13.1 11.5\n",
|
393 |
+
"175 176 276.9 48.9 41.8 27.0\n",
|
394 |
+
"176 177 248.4 30.2 20.3 20.2\n",
|
395 |
+
"177 178 170.2 7.8 35.2 11.7\n",
|
396 |
+
"178 179 276.7 2.3 23.7 11.8\n",
|
397 |
+
"179 180 165.6 10.0 17.6 12.6\n",
|
398 |
+
"180 181 156.6 2.6 8.3 10.5\n",
|
399 |
+
"181 182 218.5 5.4 27.4 12.2\n",
|
400 |
+
"182 183 56.2 5.7 29.7 8.7\n",
|
401 |
+
"183 184 287.6 43.0 71.8 26.2\n",
|
402 |
+
"184 185 253.8 21.3 30.0 17.6\n",
|
403 |
+
"185 186 205.0 45.1 19.6 22.6\n",
|
404 |
+
"186 187 139.5 2.1 26.6 10.3\n",
|
405 |
+
"187 188 191.1 28.7 18.2 17.3\n",
|
406 |
+
"188 189 286.0 13.9 3.7 15.9\n",
|
407 |
+
"189 190 18.7 12.1 23.4 6.7\n",
|
408 |
+
"190 191 39.5 41.1 5.8 10.8\n",
|
409 |
+
"191 192 75.5 10.8 6.0 9.9\n",
|
410 |
+
"192 193 17.2 4.1 31.6 5.9\n",
|
411 |
+
"193 194 166.8 42.0 3.6 19.6\n",
|
412 |
+
"194 195 149.7 35.6 6.0 17.3\n",
|
413 |
+
"195 196 38.2 3.7 13.8 7.6\n",
|
414 |
+
"196 197 94.2 4.9 8.1 9.7\n",
|
415 |
+
"197 198 177.0 9.3 6.4 12.8\n",
|
416 |
+
"198 199 283.6 42.0 66.2 25.5\n",
|
417 |
+
"199 200 232.1 8.6 8.7 13.4\n"
|
418 |
+
]
|
419 |
+
}
|
420 |
+
],
|
421 |
+
"source": [
|
422 |
+
"dataset=pd.read_csv('Advertising.csv')\n",
|
423 |
+
"print(dataset.to_string())"
|
424 |
+
]
|
425 |
+
},
|
426 |
+
{
|
427 |
+
"cell_type": "code",
|
428 |
+
"execution_count": 9,
|
429 |
+
"id": "7967d3ba",
|
430 |
+
"metadata": {},
|
431 |
+
"outputs": [
|
432 |
+
{
|
433 |
+
"name": "stdout",
|
434 |
+
"output_type": "stream",
|
435 |
+
"text": [
|
436 |
+
" Unnamed: 0 TV radio newspaper sales\n",
|
437 |
+
"190 191 39.5 41.1 5.8 10.8\n",
|
438 |
+
"191 192 75.5 10.8 6.0 9.9\n",
|
439 |
+
"192 193 17.2 4.1 31.6 5.9\n",
|
440 |
+
"193 194 166.8 42.0 3.6 19.6\n",
|
441 |
+
"194 195 149.7 35.6 6.0 17.3\n",
|
442 |
+
"195 196 38.2 3.7 13.8 7.6\n",
|
443 |
+
"196 197 94.2 4.9 8.1 9.7\n",
|
444 |
+
"197 198 177.0 9.3 6.4 12.8\n",
|
445 |
+
"198 199 283.6 42.0 66.2 25.5\n",
|
446 |
+
"199 200 232.1 8.6 8.7 13.4\n"
|
447 |
+
]
|
448 |
+
}
|
449 |
+
],
|
450 |
+
"source": [
|
451 |
+
"print(dataset.tail(10))"
|
452 |
+
]
|
453 |
+
},
|
454 |
+
{
|
455 |
+
"cell_type": "code",
|
456 |
+
"execution_count": 11,
|
457 |
+
"id": "1347c424",
|
458 |
+
"metadata": {},
|
459 |
+
"outputs": [
|
460 |
+
{
|
461 |
+
"name": "stdout",
|
462 |
+
"output_type": "stream",
|
463 |
+
"text": [
|
464 |
+
"60\n"
|
465 |
+
]
|
466 |
+
}
|
467 |
+
],
|
468 |
+
"source": [
|
469 |
+
"print(pd.options.display.max_rows)"
|
470 |
+
]
|
471 |
+
},
|
472 |
+
{
|
473 |
+
"cell_type": "code",
|
474 |
+
"execution_count": 12,
|
475 |
+
"id": "0053340d",
|
476 |
+
"metadata": {},
|
477 |
+
"outputs": [
|
478 |
+
{
|
479 |
+
"name": "stdout",
|
480 |
+
"output_type": "stream",
|
481 |
+
"text": [
|
482 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
483 |
+
"RangeIndex: 200 entries, 0 to 199\n",
|
484 |
+
"Data columns (total 5 columns):\n",
|
485 |
+
" # Column Non-Null Count Dtype \n",
|
486 |
+
"--- ------ -------------- ----- \n",
|
487 |
+
" 0 Unnamed: 0 200 non-null int64 \n",
|
488 |
+
" 1 TV 200 non-null float64\n",
|
489 |
+
" 2 radio 200 non-null float64\n",
|
490 |
+
" 3 newspaper 200 non-null float64\n",
|
491 |
+
" 4 sales 200 non-null float64\n",
|
492 |
+
"dtypes: float64(4), int64(1)\n",
|
493 |
+
"memory usage: 7.9 KB\n",
|
494 |
+
"None\n"
|
495 |
+
]
|
496 |
+
}
|
497 |
+
],
|
498 |
+
"source": [
|
499 |
+
"print(dataset.info())\n"
|
500 |
+
]
|
501 |
+
},
|
502 |
+
{
|
503 |
+
"cell_type": "code",
|
504 |
+
"execution_count": 13,
|
505 |
+
"id": "ed6b5c85",
|
506 |
+
"metadata": {},
|
507 |
+
"outputs": [
|
508 |
+
{
|
509 |
+
"name": "stdout",
|
510 |
+
"output_type": "stream",
|
511 |
+
"text": [
|
512 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
513 |
+
"RangeIndex: 101 entries, 0 to 100\n",
|
514 |
+
"Data columns (total 18 columns):\n",
|
515 |
+
" # Column Non-Null Count Dtype \n",
|
516 |
+
"--- ------ -------------- ----- \n",
|
517 |
+
" 0 animal_name 101 non-null object\n",
|
518 |
+
" 1 hair 101 non-null int64 \n",
|
519 |
+
" 2 feathers 101 non-null int64 \n",
|
520 |
+
" 3 eggs 101 non-null int64 \n",
|
521 |
+
" 4 milk 101 non-null int64 \n",
|
522 |
+
" 5 airborne 101 non-null int64 \n",
|
523 |
+
" 6 aquatic 101 non-null int64 \n",
|
524 |
+
" 7 predator 101 non-null int64 \n",
|
525 |
+
" 8 toothed 101 non-null int64 \n",
|
526 |
+
" 9 backbone 101 non-null int64 \n",
|
527 |
+
" 10 breathes 101 non-null int64 \n",
|
528 |
+
" 11 venomous 101 non-null int64 \n",
|
529 |
+
" 12 fins 101 non-null int64 \n",
|
530 |
+
" 13 legs 101 non-null int64 \n",
|
531 |
+
" 14 tail 101 non-null int64 \n",
|
532 |
+
" 15 domestic 101 non-null int64 \n",
|
533 |
+
" 16 catsize 101 non-null int64 \n",
|
534 |
+
" 17 class_type 101 non-null int64 \n",
|
535 |
+
"dtypes: int64(17), object(1)\n",
|
536 |
+
"memory usage: 14.3+ KB\n",
|
537 |
+
"None\n"
|
538 |
+
]
|
539 |
+
}
|
540 |
+
],
|
541 |
+
"source": [
|
542 |
+
"print(dataset2.info())"
|
543 |
+
]
|
544 |
+
},
|
545 |
+
{
|
546 |
+
"cell_type": "code",
|
547 |
+
"execution_count": 14,
|
548 |
+
"id": "109d99a3",
|
549 |
+
"metadata": {},
|
550 |
+
"outputs": [
|
551 |
+
{
|
552 |
+
"name": "stdout",
|
553 |
+
"output_type": "stream",
|
554 |
+
"text": [
|
555 |
+
"23.264000000000024\n"
|
556 |
+
]
|
557 |
+
}
|
558 |
+
],
|
559 |
+
"source": [
|
560 |
+
"print(dataset['radio'].mean())"
|
561 |
+
]
|
562 |
+
},
|
563 |
+
{
|
564 |
+
"cell_type": "code",
|
565 |
+
"execution_count": 15,
|
566 |
+
"id": "2ff8fd70",
|
567 |
+
"metadata": {},
|
568 |
+
"outputs": [
|
569 |
+
{
|
570 |
+
"name": "stdout",
|
571 |
+
"output_type": "stream",
|
572 |
+
"text": [
|
573 |
+
"0 4.1\n",
|
574 |
+
"1 5.7\n",
|
575 |
+
"Name: radio, dtype: float64\n"
|
576 |
+
]
|
577 |
+
}
|
578 |
+
],
|
579 |
+
"source": [
|
580 |
+
"print(dataset['radio'].mode())"
|
581 |
+
]
|
582 |
+
},
|
583 |
+
{
|
584 |
+
"cell_type": "code",
|
585 |
+
"execution_count": null,
|
586 |
+
"id": "ec82cd0a",
|
587 |
+
"metadata": {},
|
588 |
+
"outputs": [],
|
589 |
+
"source": []
|
590 |
+
},
|
591 |
+
{
|
592 |
+
"cell_type": "code",
|
593 |
+
"execution_count": 16,
|
594 |
+
"id": "fd136034",
|
595 |
+
"metadata": {},
|
596 |
+
"outputs": [
|
597 |
+
{
|
598 |
+
"name": "stdout",
|
599 |
+
"output_type": "stream",
|
600 |
+
"text": [
|
601 |
+
"22.9\n"
|
602 |
+
]
|
603 |
+
}
|
604 |
+
],
|
605 |
+
"source": [
|
606 |
+
"print(dataset['radio'].median())"
|
607 |
+
]
|
608 |
+
},
|
609 |
+
{
|
610 |
+
"cell_type": "code",
|
611 |
+
"execution_count": 1,
|
612 |
+
"id": "b0f24bb1",
|
613 |
+
"metadata": {},
|
614 |
+
"outputs": [],
|
615 |
+
"source": [
|
616 |
+
"import pandas as pd"
|
617 |
+
]
|
618 |
+
},
|
619 |
+
{
|
620 |
+
"cell_type": "code",
|
621 |
+
"execution_count": 7,
|
622 |
+
"id": "31734cdf",
|
623 |
+
"metadata": {},
|
624 |
+
"outputs": [],
|
625 |
+
"source": [
|
626 |
+
"import matplotlib as mt"
|
627 |
+
]
|
628 |
+
},
|
629 |
+
{
|
630 |
+
"cell_type": "code",
|
631 |
+
"execution_count": 19,
|
632 |
+
"id": "682ce274",
|
633 |
+
"metadata": {},
|
634 |
+
"outputs": [
|
635 |
+
{
|
636 |
+
"name": "stdout",
|
637 |
+
"output_type": "stream",
|
638 |
+
"text": [
|
639 |
+
" Duration Pulse Maxpulse Calories\n",
|
640 |
+
"0 60 110 130 409.1\n",
|
641 |
+
"1 60 117 145 479.0\n",
|
642 |
+
"2 60 103 135 340.0\n",
|
643 |
+
"3 45 109 175 282.4\n",
|
644 |
+
"4 45 117 148 406.0\n"
|
645 |
+
]
|
646 |
+
},
|
647 |
+
{
|
648 |
+
"ename": "AttributeError",
|
649 |
+
"evalue": "module 'matplotlib' has no attribute 'show'",
|
650 |
+
"output_type": "error",
|
651 |
+
"traceback": [
|
652 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
653 |
+
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
|
654 |
+
"Input \u001b[0;32mIn [19]\u001b[0m, in \u001b[0;36m<cell line: 4>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28mprint\u001b[39m(df\u001b[38;5;241m.\u001b[39mhead())\n\u001b[1;32m 3\u001b[0m df\u001b[38;5;241m.\u001b[39mplot(kind\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mscatter\u001b[39m\u001b[38;5;124m'\u001b[39m, x\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mDuration\u001b[39m\u001b[38;5;124m'\u001b[39m,y\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mMaxpulse\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m----> 4\u001b[0m \u001b[43mmt\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshow\u001b[49m()\n",
|
655 |
+
"File \u001b[0;32m/opt/anaconda3/lib/python3.9/site-packages/matplotlib/_api/__init__.py:222\u001b[0m, in \u001b[0;36mcaching_module_getattr.<locals>.__getattr__\u001b[0;34m(name)\u001b[0m\n\u001b[1;32m 220\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m name \u001b[38;5;129;01min\u001b[39;00m props:\n\u001b[1;32m 221\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m props[name]\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__get__\u001b[39m(instance)\n\u001b[0;32m--> 222\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\n\u001b[1;32m 223\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodule \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__module__\u001b[39m\u001b[38;5;132;01m!r}\u001b[39;00m\u001b[38;5;124m has no attribute \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mname\u001b[38;5;132;01m!r}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n",
|
656 |
+
"\u001b[0;31mAttributeError\u001b[0m: module 'matplotlib' has no attribute 'show'"
|
657 |
+
]
|
658 |
+
},
|
659 |
+
{
|
660 |
+
"data": {
|
661 |
+
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAhjUlEQVR4nO3dfZBc1Xnn8e8zPaPRICnWMCNko5GQbIlkeVXwwEqrBQPOGsflQs7aS0HZK5LYppLCXr9UzMu6Chx2qbJwYle8rJ3CNsZibVgtOECoTcxbMLaDwCNWb0AIE8tGw8tIGkQYCWlen/2jb7e6m+6Ze+f2vXe65/epmlL36b7d505r+rnnnOecY+6OiIgIQEvWFRARkdlDQUFERIoUFEREpEhBQUREihQURESkqDXrCsTR3d3tK1euzLoaIiINZfv27QfdfUm1xxo6KKxcuZK+vr6sqyEi0lDM7De1HlP3kYiIFCkoiIhIkYKCiIgUKSiIiEiRgoKIiBQpKIhIZEOHR9i57w2GDo9kXRWps4ZOSRWR9N2/42WuvXcXbS0tjE1OcstHz+LStcuyrpbUiVoKIhLa0OERrr13F8fGJhkeGefY2CTX3LtLLYYmoqAgIqENHDpKW0v510ZbSwsDh45mVCOpNwUFEQmtp7ODscnJsrKxyUl6OjsyqpHUm4LCDGm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IRkSIFBRERKVJQEBGRIgUFEREpUlAQEZEiBQURESlSUBARkaL/D5gQBPxGKMAbAAAAAElFTkSuQmCC\n",
|
662 |
+
"text/plain": [
|
663 |
+
"<Figure size 432x288 with 1 Axes>"
|
664 |
+
]
|
665 |
+
},
|
666 |
+
"metadata": {
|
667 |
+
"needs_background": "light"
|
668 |
+
},
|
669 |
+
"output_type": "display_data"
|
670 |
+
}
|
671 |
+
],
|
672 |
+
"source": [
|
673 |
+
"df=pd.read_csv('data.csv')\n",
|
674 |
+
"print(df.head())\n",
|
675 |
+
"df.plot(kind='scatter', x='Duration',y='Maxpulse')\n",
|
676 |
+
"mt.show()"
|
677 |
+
]
|
678 |
+
},
|
679 |
+
{
|
680 |
+
"cell_type": "code",
|
681 |
+
"execution_count": 21,
|
682 |
+
"id": "297abc8e",
|
683 |
+
"metadata": {},
|
684 |
+
"outputs": [],
|
685 |
+
"source": [
|
686 |
+
"df2=pd.read_csv('loan_data.csv')"
|
687 |
+
]
|
688 |
+
},
|
689 |
+
{
|
690 |
+
"cell_type": "code",
|
691 |
+
"execution_count": 22,
|
692 |
+
"id": "5c902c2a",
|
693 |
+
"metadata": {},
|
694 |
+
"outputs": [
|
695 |
+
{
|
696 |
+
"name": "stdout",
|
697 |
+
"output_type": "stream",
|
698 |
+
"text": [
|
699 |
+
" model mpg cyl disp hp drat wt qsec vs am gear \\\n",
|
700 |
+
"0 Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 \n",
|
701 |
+
"1 Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 \n",
|
702 |
+
"2 Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 \n",
|
703 |
+
"3 Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 \n",
|
704 |
+
"4 Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 \n",
|
705 |
+
"\n",
|
706 |
+
" carb \n",
|
707 |
+
"0 4 \n",
|
708 |
+
"1 4 \n",
|
709 |
+
"2 1 \n",
|
710 |
+
"3 1 \n",
|
711 |
+
"4 2 \n"
|
712 |
+
]
|
713 |
+
}
|
714 |
+
],
|
715 |
+
"source": [
|
716 |
+
"print(df2.head())"
|
717 |
+
]
|
718 |
+
},
|
719 |
+
{
|
720 |
+
"cell_type": "code",
|
721 |
+
"execution_count": 23,
|
722 |
+
"id": "a8d6cd28",
|
723 |
+
"metadata": {},
|
724 |
+
"outputs": [
|
725 |
+
{
|
726 |
+
"name": "stdout",
|
727 |
+
"output_type": "stream",
|
728 |
+
"text": [
|
729 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
730 |
+
"RangeIndex: 32 entries, 0 to 31\n",
|
731 |
+
"Data columns (total 12 columns):\n",
|
732 |
+
" # Column Non-Null Count Dtype \n",
|
733 |
+
"--- ------ -------------- ----- \n",
|
734 |
+
" 0 model 32 non-null object \n",
|
735 |
+
" 1 mpg 32 non-null float64\n",
|
736 |
+
" 2 cyl 32 non-null int64 \n",
|
737 |
+
" 3 disp 32 non-null float64\n",
|
738 |
+
" 4 hp 32 non-null int64 \n",
|
739 |
+
" 5 drat 32 non-null float64\n",
|
740 |
+
" 6 wt 32 non-null float64\n",
|
741 |
+
" 7 qsec 32 non-null float64\n",
|
742 |
+
" 8 vs 32 non-null int64 \n",
|
743 |
+
" 9 am 32 non-null int64 \n",
|
744 |
+
" 10 gear 32 non-null int64 \n",
|
745 |
+
" 11 carb 32 non-null int64 \n",
|
746 |
+
"dtypes: float64(5), int64(6), object(1)\n",
|
747 |
+
"memory usage: 3.1+ KB\n",
|
748 |
+
"None\n"
|
749 |
+
]
|
750 |
+
}
|
751 |
+
],
|
752 |
+
"source": [
|
753 |
+
"print(df2.info())"
|
754 |
+
]
|
755 |
+
},
|
756 |
+
{
|
757 |
+
"cell_type": "code",
|
758 |
+
"execution_count": null,
|
759 |
+
"id": "7cce9436",
|
760 |
+
"metadata": {},
|
761 |
+
"outputs": [],
|
762 |
+
"source": [
|
763 |
+
"df2"
|
764 |
+
]
|
765 |
+
}
|
766 |
+
],
|
767 |
+
"metadata": {
|
768 |
+
"kernelspec": {
|
769 |
+
"display_name": "Python 3 (ipykernel)",
|
770 |
+
"language": "python",
|
771 |
+
"name": "python3"
|
772 |
+
},
|
773 |
+
"language_info": {
|
774 |
+
"codemirror_mode": {
|
775 |
+
"name": "ipython",
|
776 |
+
"version": 3
|
777 |
+
},
|
778 |
+
"file_extension": ".py",
|
779 |
+
"mimetype": "text/x-python",
|
780 |
+
"name": "python",
|
781 |
+
"nbconvert_exporter": "python",
|
782 |
+
"pygments_lexer": "ipython3",
|
783 |
+
"version": "3.9.12"
|
784 |
+
}
|
785 |
+
},
|
786 |
+
"nbformat": 4,
|
787 |
+
"nbformat_minor": 5
|
788 |
+
}
|