Exploring Data Input/Output in Pandas π₯π€

π Hello! I'm passionate about DevOps and have over 1+ years of experience in the field. I'm proficient in a variety of cutting-edge technologies and always motivated to expand my knowledge and skills. Let's connect and grow together!
SKILLS:
πΉ Languages & Runtimes: Python, Shell Scripting, HCL, YAML πΉ Cloud Technologies: AWS, Microsoft Azure, GCP πΉ Infrastructure Tools: Docker, Terraform, AWS CloudFormation πΉ Other Tools: Linux, Git and GitHub Actions, Jenkins, Jira, GitLab (beginner), Docker, AWS DevOps πΉ Web Development: HTML, CSS, Bootstrap, Python, SQL
Job & Responsibilities:
π Improved development efficiency by implementing CI/CD pipelines, resulting in a 30% reduction in deployment time on the test server. π Strengthened deployment and testing reliability by utilizing Docker containers and optimizing Dockerfile, reducing development issues on the test server by 20%. βοΈ Automated S3 bucket log creation with Shell scripting, eliminating 100% of manual search and saving 2 hours per week. π Scheduled EC2 instance start/stop using Lambda functions and Event Bridge, leading to a 25% decrease in infrastructure costs. π§ Utilized AWS, Linux, Python, Docker, Shell scripting, Terraform, Jenkins Pipelines, and automation to streamline workflows and improve overall system performance.
I'm very detail-oriented and possess strong written and verbal communication skills. As a high performer with a possibility mindset, I strive to solve problems using efficient approaches.
Let's Connect & Grow:
If you find my profile suitable for the role you are searching for, please feel free to reach out to me at sumanprasad9766@gmail.com.
Introduction to Data Input/Output π
Data Input/Output (I/O) in Pandas refers to the process of reading and writing data to various file formats. This capability is crucial for working with real-world datasets stored in different sources. Pandas simplifies these operations, allowing seamless interaction with popular file formats like CSV, Excel, SQL, and more.
Reading and Writing Data ππ
Pandas provides a set of functions for reading data from different sources and writing data to various file formats. Let's explore how to perform these operations:
Reading Data π
Use Case: Reading from a CSV file
# Example
import pandas as pd
# Read data from a CSV file
df = pd.read_csv('your_data.csv')
# Display the DataFrame
print(df)
Use Case: Reading from an Excel file
# Example
import pandas as pd
# Read data from an Excel file
df = pd.read_excel('your_data.xlsx', sheet_name='Sheet1')
# Display the DataFrame
print(df)
Writing Data π
Use Case: Writing to a CSV file
# Example
import pandas as pd
# Create a DataFrame
data = {'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [25, 30, 35]}
df = pd.DataFrame(data)
# Write DataFrame to a CSV file
df.to_csv('output_data.csv', index=False)
Use Case: Writing to an Excel file
# Example
import pandas as pd
# Create a DataFrame
data = {'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [25, 30, 35]}
df = pd.DataFrame(data)
# Write DataFrame to an Excel file
df.to_excel('output_data.xlsx', sheet_name='Sheet1', index=False)
Supported File Formats π
Pandas supports a variety of file formats for data I/O. Some of the commonly used formats include:
CSV (Comma-Separated Values): Ideal for tabular data storage.
Excel: Perfect for spreadsheet-style data with multiple sheets.
SQL: Enables reading and writing data directly to and from databases.
Use Case: Reading from a SQL Database
# Example
import pandas as pd
from sqlalchemy import create_engine
# Create a SQLite database engine
engine = create_engine('sqlite:///your_database.db')
# Read data from a SQL table
df = pd.read_sql_table('your_table', con=engine)
# Display the DataFrame
print(df)
Use Case: Writing to a SQL Database
# Example
import pandas as pd
from sqlalchemy import create_engine
# Create a SQLite database engine
engine = create_engine('sqlite:///your_database.db')
# Write DataFrame to a SQL table
df.to_sql('your_table', con=engine, index=False, if_exists='replace')
Pandas' data I/O capabilities make it a versatile tool for handling data stored in different formats and locations. Whether you're reading from a CSV file, Excel spreadsheet, or a SQL database, Pandas simplifies the process, allowing you to focus on extracting insights from your data. π




