Extract the data and transform the data

Assignment Help Python Programming
Reference no: EM132631481

Each text file contains information about the tweets, i.e., "id", "text", and "created_at" attributes. Your task is to extract the data and transform the data into the XML format with the following elements:

1. id: is a 19-digit number.

2. text: is the actual tweet.

3. Created_at: is the date and time that the tweet was created

The XML file must be in the same structure as the sample folder. Please note that, as we are dealing with large datasets, the manual checking of outputs is impossible and output files would be processed and marked automatically therefore, any deviation from the XML structure (i.e. sample.xml) and any deviation from this structure (e.g. wrong key names which can be caused by different spelling, different upper/lower case, etc., wrong hierarchy, not handling the XML special characters,...) will result in receiving zero for the output mark as the marking script would fail to load your file. (hint: run your code on the provided example and make sure that your code results in the exact same output as the sample output. You can also use the "xmltodict" package to make sure that your XML is loadable).

Beside the XML structure, the following constraints must also be satisfied:

1. The "id"s must be unique, so if there are multiple instances of the same tweets, you must only keep one of them in your final XML file.

2. The non-english tweets should be filtered out from the dataset and the final XML should only contain the tweets in English language. For the sake of consistency, you must use the langid package to classify the language of a tweet.

3. The re, os, and the langid packages in Python are the only packages that you are allowed to use for the task 1 of this assessment (e.g., "pandas" is not allowed!). Any other packages that you need to "import" before usage is not allowed.

Attachment:- Data wrangling.rar

Reference no: EM132631481

Questions Cloud

Can you relate to article on self-disclosure in relationship : Can you relate to this article on self-disclosure in relationships? If so, explain what specifically you could relate to and provide examples of your own.
Explain the functions of nonverbal communication : Describe an instance of miscommunication based on nonverbal communication. Connect this experience to one or more functions of nonverbal communication.
Discuss the importance of verbal skills in communication : In Chapter 4 of your text, titled Verbal and Nonverbal Communication: Making Every Word and Gesture Matter, Bevan & Sole (2014) discuss the power of language.
Calculate the coordinates of the radiated points : Calculate the angular misclose and the adjusted bearings of all the traverse lines and radiations and calculate the coordinates of the radiated points
Extract the data and transform the data : Extract the data and transform the data into the XML format - deviation from the XML structure - The "id"s must be unique, so if there are multiple instances
Calculate annual depreciation charge for each of six year : Calculate the annual depreciation charge for each of the six years of the truck's life using the declining-balance method and sum-of-digits method
Describe the talking styles in brief : Read "Shared talking styles herald new and lasting romance". Then, visit the Language Style Matching website and, using sample written communication between.
How do calculate the portfolio beta : Calculate the Portfolio's Beta. Corporation holds a diversified portfolio consisting of $6000 investment in each of 20 different common stocks.
Define self-concept and self-image in brief : Define self-concept, self-image, and self-esteem. Write at least two sentences on each term. Provide an example of how your "self-concept," "self-image,".

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd