Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 248 additions & 0 deletions assignment3.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Untitled5.ipynb",
"version": "0.3.2",
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"[View in Colaboratory](https://colab.research.google.com/github/Anb91/Assignment-3/blob/Anb91/assignment3.ipynb)"
]
},
{
"metadata": {
"id": "h3XDo38EDd-4",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"import numpy as np\n",
"import pandas as pd"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "CSh7wgb7DiFD",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"wine_df = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data')"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "nQZCkgC8Dkvh",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"wine_df.head(5)"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "-QEzrvZHDk2d",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"wine_df_copy=wine_df.iloc[::2]\n",
"print(wine_df_copy)"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "d4DDViujDk7T",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"wine_df_copy.columns=['','Alcohol', 'Malic acid','Ash','Alcalinity of ash','Magnesium',' Total phenols',' Flavanoids',' Nonflavanoid phenols',' Proanthocyanins','Color intensity','Hue','OD280/OD315 of diluted wines','Proline' ]\n",
"wine_df_copy.head(5)"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "pVtWVk7KDlBO",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"for i in range(3):\n",
" wine_df.iloc[i,0]='nan'\n",
"wine_df.head(5)"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "H0B8qHSmDlGG",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"import random\n",
"number =[]\n",
"for i in range(10):\n",
" number.append(random.randrange(1,160))\n",
"random=number\n",
"print(random)"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "k3EGsvNbDlL6",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"for i in range(10):\n",
" wine_df.iloc[random[i],0]= 'nan'"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "dTKzbPOdDldR",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"null=wine_df.isnull().sum()\n",
"print(null)"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "7O6AKeQPDlap",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"wine_df =wine_df.notnull()"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "epUVg4osDlTE",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "jwdFuF_GDlh8",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "lrrAIJsvDlnY",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "xvfnlQ83DlsY",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "wbFmL0GPDlW2",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "JihUjuMNDlQe",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
}
]
}