The is a jupyter notebook for Case 1 (Part A). Read the text and code comments Create a dictionary of words (keys) and the ratio of the word's length and mean word length in `mwl`. Assign this new dictionary to a variable `wlr`below carefully so you know what to do. The required tasks are listed below. Create a list of the words in `wlr` that are more than twice as long as the average word (`wlr`). Assign this list to the variable `big_words`
Added by Marc S.
Step 1
Let's think step by step. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 66 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Tasks To Be Performed: 1. Start off by importing the customer_churn.csv file in the Jupyter Notebook and store that in the churn DataFrame. 2. From the churn DataFrame, select only the 3rd, 7th, 9th, and 20th columns and all the rows, and store that in a new DataFrame named newCols. 3. From the original DataFrame, select only the rows from the 200th index till the 1000th index (inclusive). 4. Now select the rows from the 20th index till the 200th index (exclusive), and columns from the 2nd index till the 15th index value. 5. Display the top 100 records from the original DataFrame. 6. Display the last 10 records from the DataFrame. 7. Display the last record from the DataFrame. 8. Now, from the churn DataFrame, try to sort the data by the tenure column in descending order. 9. Fetch all the records that satisfy the following conditions: a. Tenure > 50 and gender as 'Female' b. Gender as 'Male' and SeniorCitizen as 0 c. TechSupport as 'Yes' and Churn as 'No' d. Contract type as 'Month-to-month' and Churn as 'Yes' 10. Use a for loop to calculate the number of customers who are getting tech support and are male senior citizens.
Akash M.
Write a program that asks the user for the name of a file. The program should read the file using the filename from step 1, assuming that each line in the file contains one word. Store each word as an element in the list, so that one list has all of the words in the file. Iterate over each item in the list using a loop, looking at the length of each word to do the following: Calculate and print the shortest word (word with the fewest letters). Calculate and print the longest word (word with the most letters). Print the average length of all words (see "Tips" below). In addition to printing the output for steps 5-7, also write this same data to a file called: word_result.txt The sample input/output below assumes a file called words.txt with these numbers (although your code must work with any filename containing any words): Mary had a little lamb Sample input/output: Enter the name of the file: words.txt Shortest word: a Longest word: little Average word length: 3.60 (The same results printed above are also stored in the file called word_result.txt)
Indicate which is the larger unit in each pair. a. $\mathrm{mm}$ or $\mathrm{cm}$ b. $\mathrm{kg}$ or $\mathrm{g}$ c. $\mathrm{dL}$ or $\mu \mathrm{L}$
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD