Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need assistance on what code to use in Python for solving the five problems below. In [4]: import numpy as np import pandas as pd

Need assistance on what code to use in Python for solving the five problems below.image text in transcribedimage text in transcribed

In [4]: import numpy as np import pandas as pd import matplotlib.pyplot as plt vacationdata - pd. read_csv ('Vacation Data.csv') origcolumnnames = vacationdata.columns newcolumnnames = origcolumnnames.str.replace("Q\d+:.", "") vacationdata.columns = newcolumnnames In [5]: origcolumnnames = vacationdata.columns origcolumnnames Out[5]: Index ( ['Respondent Number', 'Vacation City', 'Season', 'Year Visited', 'Trip Duration in Days', 'Number of Overseas Trips Taken', Total Trip Cost (includes air)', 'Airfare Cost', 'Amount Spent on Souvenirs', 'First Time to this city', 'Traveled Alone', '011', 'The City had Good Restuarants', '212', My Accomodations were Good', 'Q13', 'There were Good Historical Sites', '014', 'Overall Trip Satisfaction', '015', 'Gender', '016', 'Race/Ethnicity', 'Number of Travelers', 'Age of Traveler', 'Hotel', 'Museums', 'Food', 'Nightlife', Activities', 'Cost', 'Hotel', 'Museums', 'Food', 'Nightlife', 'Activities', 'Cost', 'I would recommend this city', 'Unnamed: 38', '019-224'], dtype='object') In [0]: #Question 1: What are the average, range, and median of Trip Duration in Days? What does this tell you? #your answer below In [1]: #Question 2: Compute a box plot of Number of Overseas Trips Taken. How would you interpret this? #your answer below In [0]: #Question 3: Create a histogram of the amount spent on souveniers. How would you interpret this? #your answer below In [0]: #Question 4: Compute the cross tab of "The City had Good Restuarants" and "Overall Trip Satisfaction". What insight do #your answer below In [0]: #Question 5: For the crosstab above, does the distribution of values match your expectation? Why or why not? #your answer below #hint think Chi^2

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

3. Identify cultural universals in nonverbal communication.

Answered: 1 week ago

Question

2. Discuss the types of messages that are communicated nonverbally.

Answered: 1 week ago