Intro To Python Flashcards
What are Strings?
Strings are primitive data type of the python language. You can think of a data type as a building block of a language. The content inside the print function is a string.(“word here”)
What are Booleans?
Boolean assess the truth of something. Boolean values are either true are false. Example: 5>7 is 5 greater than 7? = false, 7<5 is 5 smaller than 7? = true
Conditional Logic
Comparison operator, Meaning < Less than <= Less than or equal to > greater than >= greater than or equal to == equal != not equal
What is numpy?
¹
True or Flase statement?
Num = 3
Is number > 10
Print(num)
True
Logical Operators?
And, or, not Can be used in conjunction with conditional logic ex: Num = 4 print(num > 0 and num < 15) Output: true
The 3 main file types and the functions to load them?
.csv files - pd.read_csv(‘filepath’)
.xlsx files - pd.read_excel(‘filepath’)
‘Filepath’ can be remote URL if it points to .csv or.xlsx file
What is df.info()
To get lots of info in, including data type, index, and column names
What is df.dtypes
To get just the data type for just all column
What us df.[‘name’].dtypes
To get the data type for just one column
What is df.head()
This will give you the top 5 rows
What us df.head(8)
To see a different number of rows such as the first 8 rows
What is df.tail()
To see the bottom 5 rows
What is df.tail(11)
To see a different number of rows such as the last 11 rows
What is df.sample(5)
To see 5 random rows