# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Lab Assignment 4
# <a href='https://courses.edx.org/courses/course-v1:Microsoft+DAT210x+4T2016/courseware/dfb4bc13bab749ceb87191a9185cb111/55399b97bcbf42098c7f3e70363733eb/?activate_block_id=block-v1%3AMicrosoft%2BDAT210x%2B4T2016%2Btype%40sequential%2Bblock%4055399b97bcbf42098c7f3e70363733eb'>link</a>
#
# For this assignment, you will continue using the wheat seeds data set. Start by opening up the starter code located in Module3/assignment4.py, and write code that...
#
# 1. Loads up the seeds dataset, located at Module3/Datasets/wheat.data into a dataframe
# 2. Drop the id, area, and perimeter features from your dataset
# 3. Plot a parallel coordinates chart, grouped by the wheat_type feature. Be sure to set the optional display parameter alpha to 0.4
#
# Once you're done, answer the following questions about your work:

# +
# imports 

import pandas as pd
from pandas.tools.plotting import parallel_coordinates
import matplotlib
import matplotlib.pyplot as plt

matplotlib.style.use('ggplot') # because it looks pretty

# +
# 1.Loads up the seeds dataset, located at Module3/Datasets/wheat.data' into a dataframe. You should be very good at doing this by now.

wheatdata_ff = r'C:\Users\ng35019\Documents\Training\python_for_ds\Module3\Datasets\wheat.data'

df = pd.read_csv(wheatdata_ff); df.head(10)

# +
# 2.Drop the id, area, and perimeter features from your dataset

df1 = df.drop(['id','area','perimeter'], axis=1); df1.head(10)
# -

help(plt.figure)

# +
# 3.Plot a parallel coordinates chart, grouped by the wheat_type feature. 
# Be sure to set the optional display parameter alpha to 0.4

plt.figure(figsize=(14,8))
parallel_coordinates(df1, 'wheat_type', alpha=0.4)

plt.show()

StarcoderdataJupyterScriptsDedupFiltered