You are on page 1of 18

PANDAS

Cheat Sheet

NAS.IO/ARTIFICIALINTELLIGENCE
1 . Basi c Commands
Pandas is a software library for Python that provides tools
for data manipulation and analysis. It' s important to ensure
that the correct version of pandas is installed for
compatibility with your code.

- Importing Pandas:

- Checking Pandas Version:

NAS.IO/ARTIFICIALINTELLIGENCE
2. Dataframe Creation
Dataframes are two-dimensional labeled data structures
with columns potentially of different types.
You can think of it like a spreadsheet or SQL table.

- From a list:

- From a Dictionary:

NAS.IO/ARTIFICIALINTELLIGENCE
3. Dat a Sel ect i on

- Selecting a column:

- Selecting multiple columns:

Pandas provides different methods for data selection.

NAS.IO/ARTIFICIALINTELLIGENCE
- Selecting rows:

- Selecting specific value:

NAS.IO/ARTIFICIALINTELLIGENCE
4. Dat a Mani pul at i on
P a n das p r o v i d e v a r i o u s w a ys to manipulate a dataset.

- A dding a c ol u m n :

- Deleting a column:

NAS.IO/ARTIFICIALINTELLIGENCE
- Renaming columns:

- Applying a function to a column:

NAS.IO/ARTIFICIALINTELLIGENCE
5. Dat a Cl eani ng
D a t a cle a n i n g i s d e t e c t i n g and correcting (or removing)
c o r rupt o r i n ac c u r a t e r e c o rds from a dataset.

- C hecki n g f or n u l l v a l u e s :

- D roppi n g n ul l v a l u e s :

NAS.IO/ARTIFICIALINTELLIGENCE
F i l ling n u l l v al u e s :

- Replacing values:

NAS.IO/ARTIFICIALINTELLIGENCE
6. Groupi ng & Aggregat i on
G r o upi n g i n v o l v e s c o m b i n i ng data based on some criteria,
w h i le ag g r e g at i o n i s t h e p rocess of turning the results of a
q u e ry in t o a si n g l e r o w .

- G roup b y :

- A ggreg a t i o n:

NAS.IO/ARTIFICIALINTELLIGENCE
7. Mergi ng, Joi ni ng, and
Concat enat i ng

Pandas provides various ways to combine DataFrames


including merge and join.

- Concatenating:

NAS.IO/ARTIFICIALINTELLIGENCE
- Merging:

- Joining:

NAS.IO/ARTIFICIALINTELLIGENCE
8. Worki ng wi t h Dat es
Pandas provides powerful functionalities for working with
dates.
- Convert to datetime:

- Extracting date parts:

NAS.IO/ARTIFICIALINTELLIGENCE
9. Fi l e I /O
Pandas can seamlessly read from and write to a variety
of file formats.

- Reading a CSV file:

- Writing to a CSV file:

- Similarly for other file formats like

NAS.IO/ARTIFICIALINTELLIGENCE
Next Steps
1. Advanced Visualization Workshops: Dive deeper into the
intricacies of data visualization with hands-on workshops.

2. Data Science Bootcamps: A comprehensive, project-based


learning experience to enhance your data science skills.

3. AI Innovation Hub: Collaborate with fellow learners and


industry experts on cutting-edge AI projects.

4. Community Webinars: Regular webinars on the latest trends,


tools, and best practices in AI and Data Science.

5. Peer-to-Peer Learning: Engage in discussion forums, group


projects, and mentorship programs.

NAS.IO/ARTIFICIALINTELLIGENCE
Take Action Now

Delivery Hero SE This document is strictly confidential and may not be copied, used, made available or be disclosed to thirdparties without prior written permission.

NAS.IO/ARTIFICIALINTELLIGENCE
https://www.youtube.com/@decodingdatascience/
Delivery Hero SE This document is strictly confidential and may not be copied, used, made available or be disclosed to thirdparties without prior written permission.

NAS.IO/ARTIFICIALINTELLIGENCE
Join Our AI Community

Being part of an AI community like ours offers multiple


benefits. You can network with like-minded individuals,
learn from experienced professionals, and stay
up-to-date with the latest AI trends and developments.

Whether you're a beginner looking to start your journey in


AI, or an experienced professional looking to enhance
your skills, our community has something to offer.

Join us and be a part of this exciting journey. Learn


more, Grow more!
Click the link in the footer to join us today!

You might also like