Sitemap

Python for Data Science & AI: Working with Data, APIs, and Data Collection | Week 11

4 min read3 days ago

--

Completing the seventh course of my IBM DevOps and Software Engineering Professional Certificate.

Introduction

Last week, I explored the fundamentals of Python programming, including data types, variables, data structures, loops, functions, exception handling, and object-oriented programming.

This week, I completed the remaining two modules of the course, Python for Data Science & AI: Hands-On Development.

The focus shifted from understanding Python programming concepts to exploring how Python can be used to work with data and collect information from different sources.

The two modules covered were:

  1. Working with Data in Python.
  2. APIs and Data Collection.

1. Working with Data in Python

The first module focused on handling data using Python.

An important part of working with real-world data is understanding how to read information from files, manipulate it, and save results in appropriate formats.

I explored how to work with different file formats, including:

  • Text files (.txt): Reading and writing plain text data.
  • CSV files (.csv): Working with tabular data arranged in rows and columns.
  • JSON files (.json): Handling structured data represented through key-value pairs and nested objects.

I practised opening, reading, writing, and manipulating files using Python.

For example, Python provides built-in functionality for reading and writing files:

# Writing to a text file
with open("sample.txt", "w") as file:
file.write("Learning Python for Data Science")
# Reading from a text file
with open("sample.txt", "r") as file:
content = file.read()
print(content)

Exploring Pandas and NumPy

I was also introduced to two important Python libraries used extensively in data science and analysis.

Pandas

Pandas is a library for working with structured data. It provides useful data structures, particularly Series and DataFrames, that make it easier to organize, manipulate, and analyse datasets.

Press enter or click to view image in full size

NumPy

NumPy supports numerical computing in Python. It provides multidimensional arrays and mathematical operations that are useful when working with numerical datasets.

Get Solomon Igidigi’s stories in your inbox

Join Medium for free to get updates from this writer.

These libraries are important because they extend Python’s built-in capabilities and make working with larger or more structured datasets more convenient.

2. APIs and Data Collection

The second module explored different approaches to collecting data.

Data analysis and data science depend on having access to relevant data. However, that data does not always come from a file already stored on your computer.

I explored two important data collection techniques:

Application Programming Interfaces (APIs)

An API provides a way for different software applications to communicate and exchange information.

In data collection, APIs allow developers and analysts to retrieve information from external services and systems.

Python can interact with APIs, send requests, and process the responses returned by those services.

Press enter or click to view image in full size

Web Scraping

Web scraping involves extracting information from websites, often when the required information is publicly available on web pages.

It can be useful for collecting information from online sources, although it is important to respect website terms of service, access restrictions, and applicable privacy requirements.

The module also included practical labs and a comprehensive final examination to assess my understanding of the course.

3. Key Takeaways

Completing these final modules helped me connect Python programming fundamentals with practical data-related applications.

Some of my key takeaways include:

  • Python can read and write data in different file formats.
  • Pandas provides useful tools for manipulating and analysing structured data.
  • NumPy makes numerical operations and array manipulation easier.
  • APIs provide a structured way to retrieve data from external applications and services.
  • Web scraping offers another approach to collecting information from websites.

One important lesson is that collecting data is only part of the process. Understanding how to read, structure, manipulate, and prepare that data is equally important.

4. Course Completion: Seven Down, Eight to Go!

With the completion of these two modules, I’ve officially completed the seventh course out of fifteen in the IBM DevOps and Software Engineering Professional Certificate.

The course has strengthened my understanding of Python, from basic programming concepts to working with data and exploring different data collection techniques.

My next step is to continue building on these foundations through more practical exercises and projects.

Seven courses completed. Eight more to go. The journey continues!

This is Week 11 of my learning journey through the IBM DevOps and Software Engineering Professional Certificate, supported by the DevCareer X Coursera Learning for Impact Scholarship Programme, Cohort 2.

--

--

Solomon Igidigi
Solomon Igidigi

Written by Solomon Igidigi

0 followers

Cloud/DevOps Engineer and IT Suppot Specialist