Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

From all the attributes available in the file, pick one numeric attribute to be the dependent variable (y), and pick five (or more if you

From all the attributes available in the file, pick one numeric attribute to be the dependent variable (y), and pick five (or more if you prefer) other reasonable numeric attributes as the independent variables (X). The final data after processing should be stored in a variable whose type is DataFrame.

Instead of using functions from pandas, use file reading/writing and while/for loops to process each line in the data file to perform the same task described in the previous question (i.e., pick y and X, and store as a DataFrame). You should first save Assignment-Q2-IBM-Data-Clean.xlsx as a CSV (comma delimited) file before using open() to open it. Tip: You can open one file for reading and one new file for writing. For each line, use list indexing to select the attributes you need to write to the new file. Use string concatenation to construct the new line to be written to the new file. After the new file is closed, you can use read_csv() to convert it to DataFrame.

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe key customer feedback collection tools.

Answered: 1 week ago

Question

Know what customers expect from the firm when they complain.

Answered: 1 week ago

Question

Understand why customers complain.

Answered: 1 week ago