Python Importing Data with Pandas & Indexing Data Frames Questions

User Generated

naqll4712

Programming

Description

Please work through the following tutorials located at the following locations:

Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages, and makes importing and analyzing data much easier. Pandas builds on packages like NumPy and matplotlib to give you a single, convenient, place to do most of your data analysis and visualization work. In this python data science tutorial, you’ll use Pandas to analyze data on video game reviews from IGN, a popular video game review site. The data was scraped by Eric Grinstein, and can be found here. As you analyze the video game reviews, you’ll learn key Pandas concepts like indexing.

Exercise 1 Link: https://www.dataquest.io/blog/pandas-python-tutorial/

You need basic Python knowledge for this tutorial. If you understand if-else statements, while and for loops, lists, and dictionaries, you’re set to make the most out of this tutorial. You also need a code editor like Visual Code Studio, PyCharm, or Atom. In addition, while we walk through every line of code so you never feel lost, knowing basic pandas would help. Check out our pandas tutorial if you need a refresher.

Exercise 2 Link: https://www.dataquest.io/blog/regular-expressions-...


Explanation & Answer:
2 Questions
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Attached.

REPORT
Exercise 1
Importing Data with Pandas
Pandas is immeasurably useful python tool for organizing data into neat tables known as data frames
to help in understanding it.
Exercise 2
This exercise involves sifting through massive amounts of text data making use of python regex
(regular expressions) module. This module provides tremendous functions and basic patterns that are
useful when it comes to string analysis. When this module is used in conjunction with the panda
library, it brings a certain order to large unorganized datasets. In this exercise to test the working of
the python regex module we make use of a sample text file fradulent_emails.txt containing multiple
fraud emails from Nigeria.
Introducing the python Regex module
The first step involves accessing the text file mentioned. A simple open and read functions can be
used for this task. We use the “r” command after the directory path to convert the strings to raw
strings which resolve conflicts in different operating systems. We can use a simple for loop to with
the re library to find and print all senders in the text file. We pass a simple string criterion on the
re.findall() function and search through the filehandler variable that contains the raw string from the
text file. The result is shown below.

Regex Patterns

The re module provides various patterns that account for scenarios where we have no idea of the
nature of the string. With these patterns we can display specific data such as email addresses, names,
dates and much more...


Anonymous
Just the thing I needed, saved me a lot of time.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags