Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can anyone help me to do these functions or give me some guidelines? Thank you! Programming Project 06 This assignment is worth 45 points (45%
Can anyone help me to do these functions or give me some guidelines? Thank you!
Programming Project 06 This assignment is worth 45 points (45% of the course grade) and must be completed and turned in before 11:59 on Monday, February, 25. Assignment Overview Files Lists and Tuples Assignment Background Life is full of wonders and uncertainties that motivates us to find answers. However, not everybody is qualified to answer such questions. We need to have a medium where various like- minded individuals with experience of certain topics to share and contribute their acquired knowledge via research articles. One well known medium to publish these articles is through research journals. These journals are centered on certain topics or categories (Biology, Computer Science, etc.), where some categories are more popular than others. This popularity is measured by their citation rate or impact factor For this project, the program reads files with the citation data of each category and the impact factor of various journals, print the average citation rate of the top 20 categories and plot the top 10 journal impact factor. The data used for this project was extracted from InCites Journal Citation Reports (https:/licr.incites.thomsonreuters.com/JCRLandingPageAction.action) Project Specifications 1. You must implement the following functions a) open file0 prompts the user for a filename to read data from. An error message should be shown if the file cannot be opened. This function will loop until it receives proper input and successfully opens the file. It returns a file pointer b) read journal_file(fp) reads the file object containing journal names and their impact factor. We are only interested in the journal name (str), total number of citations (int)(a.k.a. "cites"), and the impact factor (float). It returns a list of tuples, sorted by the impact factor (descending order) (Hint: place your sort outside your loop, otherwise it will take too long and your Mimir test will timeout and fail). Only read the first 30 characters for the journal name. Make sure to remove all commas from all strings with numeric values. See Notes and Hints. Make sure to check that the entries in citations CSE 231 Spring 2019 The list with the citation data per category needs to be sorted by the specified column and then display the sorted list. Only the first 20 categories will be displayed. Then, the user should be asked if they want to plot data: the pssible answers are yes or no. Capitalization does not matter If yes, sorts and plots the journal impact factor data. First it extracts the name labels and impact factor of the journal citation data and then calls the plotdata( function provided. Deliverables The deliverable for this assignment is the following file proj06.py - the source code for your Python program Be sure to use the specified file name and to submit it for grading via the Mimir system before the project deadline Notes and Hints 1. 2. The replace function is useful to remove unwanted characters from a string When reading the citation and journal files, use the reader function from csv module to read each line of the file because some values have commas. import csv fp -open file() reader csv. reader (fp) # create csv reader header next (reader, None) # read one line (useful for skip) for line list in reader: #line list is a list of the line 3. The try-except structure will help determine whether the current column is numeric You can try to convert a string to a float number. If Python raises a ValueError, it means that converting the string to a float type is not possible try: x- float (some str) except ValueError: # do something because some-str isn't a float Sample Output: read journal file function: popen ('journal_impact_small.csv','r') Programming Project 06 This assignment is worth 45 points (45% of the course grade) and must be completed and turned in before 11:59 on Monday, February, 25. Assignment Overview Files Lists and Tuples Assignment Background Life is full of wonders and uncertainties that motivates us to find answers. However, not everybody is qualified to answer such questions. We need to have a medium where various like- minded individuals with experience of certain topics to share and contribute their acquired knowledge via research articles. One well known medium to publish these articles is through research journals. These journals are centered on certain topics or categories (Biology, Computer Science, etc.), where some categories are more popular than others. This popularity is measured by their citation rate or impact factor For this project, the program reads files with the citation data of each category and the impact factor of various journals, print the average citation rate of the top 20 categories and plot the top 10 journal impact factor. The data used for this project was extracted from InCites Journal Citation Reports (https:/licr.incites.thomsonreuters.com/JCRLandingPageAction.action) Project Specifications 1. You must implement the following functions a) open file0 prompts the user for a filename to read data from. An error message should be shown if the file cannot be opened. This function will loop until it receives proper input and successfully opens the file. It returns a file pointer b) read journal_file(fp) reads the file object containing journal names and their impact factor. We are only interested in the journal name (str), total number of citations (int)(a.k.a. "cites"), and the impact factor (float). It returns a list of tuples, sorted by the impact factor (descending order) (Hint: place your sort outside your loop, otherwise it will take too long and your Mimir test will timeout and fail). Only read the first 30 characters for the journal name. Make sure to remove all commas from all strings with numeric values. See Notes and Hints. Make sure to check that the entries in citations CSE 231 Spring 2019 The list with the citation data per category needs to be sorted by the specified column and then display the sorted list. Only the first 20 categories will be displayed. Then, the user should be asked if they want to plot data: the pssible answers are yes or no. Capitalization does not matter If yes, sorts and plots the journal impact factor data. First it extracts the name labels and impact factor of the journal citation data and then calls the plotdata( function provided. Deliverables The deliverable for this assignment is the following file proj06.py - the source code for your Python program Be sure to use the specified file name and to submit it for grading via the Mimir system before the project deadline Notes and Hints 1. 2. The replace function is useful to remove unwanted characters from a string When reading the citation and journal files, use the reader function from csv module to read each line of the file because some values have commas. import csv fp -open file() reader csv. reader (fp) # create csv reader header next (reader, None) # read one line (useful for skip) for line list in reader: #line list is a list of the line 3. The try-except structure will help determine whether the current column is numeric You can try to convert a string to a float number. If Python raises a ValueError, it means that converting the string to a float type is not possible try: x- float (some str) except ValueError: # do something because some-str isn't a float Sample Output: read journal file function: popen ('journal_impact_small.csv','r')Step 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