Answered step by step
Verified Expert Solution
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.
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^2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started