Python Data Science Cheat Sheet

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/23

flashcard set

Earn XP

Description and Tags

Flashcards to help beginners and intermediate users learn Python for data science.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

24 Terms

1
New cards

Python

A popular programming language in data science known for its ease of learning and powerful libraries for data analysis.

2
New cards

Packages

Collections of useful tools developed by the open-source community that extend the capabilities of the Python language.

3
New cards

pip install pandas

Command prompt command to install a new Python package (example: pandas).

4
New cards

Working Directory

The default file path that Python reads or saves files into.

5
New cards

os library

Needed to set and get the working directory in Python.

6
New cards

Arithmetic Operators

  • (addition), - (subtraction), * (multiplication), / (division), // (integer division), ^ (raise to the power), % (remainder after division).
7
New cards

Assignment Operators

Used to assign values to variables (e.g., a = 5) or change the value of an item in a list (e.g., x[0] = 1).

8
New cards

Numeric Comparison Operators

== (equal to), != (not equal to), > (greater than), >= (greater than or equal to), < (less than), <= (less than or equal to).

9
New cards

Logical Operators

not (logical NOT), and (logical AND), or (logical OR).

10
New cards

List

An ordered and changeable sequence of elements that can hold integers, characters, floats, strings, and objects.

11
New cards

Zero-indexed

Python lists are zero-indexed, meaning the first element has index 0.

12
New cards

Dictionary

Stores data values in key-value pairs, indexed by unique keys (names).

13
New cards

NumPy

A Python package for scientific computing that provides multidimensional array objects and efficient operations on them.

14
New cards

np.array([1, 2, 3])

Convert a python list to a NumPy array

15
New cards

String

A sequence of characters, created with double or single quotes.

16
New cards

str[0]

Get the character at a specific position

17
New cards

Concatenate strings (+)

Combines strings together

18
New cards

Pandas

A fast and powerful package for data analysis and manipulation in Python.

19
New cards

DataFrame

A Pandas structure that contains two-dimensional data stored as rows and columns.

20
New cards

Series

A Pandas structure that contains one-dimensional data.

21
New cards

pd.concat([df, df])

Concatenate DataFrames vertically

22
New cards

str.upper()

Convert a string to uppercase

23
New cards

str.lower()

Convert a string to lowercase

24
New cards

df.mean()

Calculate the mean of each column