Please enable JavaScript.
Coggle requires JavaScript to display documents.
Primitive Data Types - all data types must be uniform in a line of code.…
Primitive Data Types - all data types must be uniform in a line of code. String and integer cannot be mixed. However, they can be converted with the commands shown. All can be checked with type()
String str()
-
Uses: String of characters, text
-
Boolean bool()
True/false values, only allows for two outcomes
-
-
-
-
-
pandas
-
Can use series, which is a one dimensional array, or dataframe, which is a combination of series
-
example
-
-
-
-
'continents = {'continent': ['North America', 'South America', 'Antarctica', 'Africa', 'Asia', 'Europe', 'Australia'],
'population': ['604 million', '439 million', '0', '1.46 billion', '4.75 billion', '740 million', '46 million'],
'biggest country': ['United States', 'Brazil', 'NA', 'Nigeria', 'India', 'Russia', 'Australia']}
ascending order = ascending = print(chipotle.sort_values(by='longitude', ascending=True))
-
-
IDEs: Places you can carry out work in Python. All use the language but have different applications/capabilities
Replit:
Pros: Allows collaboration, easy UI, open access
Cons: Struggles with larger programs, AI is inevitable, not compatible with everything, can only run in main,
Spyder:
Pros: Track variables, help embedded, run individual lines, troubleshooting line by line, good for big programs
Cons: Lots of installation, no groupwork, more complex setup
Colab:
Pros: Allows for chunking of programs, allows collaboration, easy UI, differentiates with color, easier troubleshooting
Cons: Lots of work to chunk and only runs whole chunk,
JSON: Java Script Object Notation, holds object with {}, arrays with [], and full of name/value dictionary pairs
Not compatible with Python, but can use Python to write to JSON and save as CSV
-
-
-
-
with open(json_browns_2023, "w") as json_file:
-
-
Loops: Allows for repetition under condition-specific circumstances. Commands are followed by indentations and colons
-
while
loops: Carry out an action while a condition is satisfied, stop when the condition is not met
-
Concatenation: Allows a combination of things to be printed. Must all be the same data type or converted to be so.
-
-