Posts

Showing posts from February, 2022

7. Python - Try / Error Handling

 try:     print(x) except:     print("NO X")

6. Python - Dictionaries

 dictionaries: // like maps map = {'key' = 5} map['key'] map['newkey'] = 55 // adds a new key and value. can also change existing keys Dictionary comprehension: dictionary = [1,2,3,5] test = {element: 1 for element in dictionary} // returns each number and a key and put in dictionary Methods: 'Key' in dictionaryname // returns true or false if key is in dictionary dictionary.keys() // return all keys dictionary.values() // return all values Loop Dictionaries: for key in dictionaries:     print("{} = {}".format(key,dictionaries[key]))

5. Python - Strings

 Strings: // Strings are arrays of characters, except strings are immutable "Print's Dog" Escaping signs: "Print\'s Dog" The table below summarizes some important uses of the backslash character. What you type... What you get example print(example) \' ' 'What\'s up?' What's up? \" " "That's \"cool\"" That's "cool" \\ \ "Look, a mountain: /\\" Look, a mountain: /\ \n "1\n2 3" 1 2 3 Auto new lines: print(""" HELLO """) Print and End: // print ends with auto newline unless specify end= print("TEST", end = "HELLO") String Methods: string.upper() // uppercase string.lower() // lowercase string.index("substring") // searches for the index where substring starts string.startswith() string.endswith() string.split('optionalseparator') // splits a string into a array of words using whitespace as separator strin

4. Python - Loops

For loop: Loop through list for element in listname:          print(element, end=' ') // print element and a space Loop through string: for element in stringname:          print(element, end=' ') Normal I Loops: for i in range(100):          do something 100 times While Loops: while panda:          print(1) List comprehensions: (short way to write list loops) squares = [n**2 for n in range(10)] // puts each value after a loop into a list called squares. // loop powers each n by 2 // LEFT = return value, MIDDLE = loop range, RIGHT = condition short_planet = [planet for planet in planets if len(planet)<6] // loop planet through planets list and see if its shorter than 6 characters and return if true test = [True if n>givennumber else False for n in List] // a if b else c // takes in a list and a given number ALT syntax: [     planet.upper() + '!'      for planet in planets      if len(planet) < 6 ]

3. Python - Lists

 Lists: listexample = ["hello", 35, 'A'] listexample[0] // returns "hello" listexample[-1] // returns 'A' at the end Slicing: listexample[0:3] // 0,1, and 2 index listexample[:3] // same as above listexample[1:-1] // exclude first and last listexample[1:] // skip first and go to end of list Functions: len(listhere) // length of list sorted(listhere) // sort ABC sum(listhere) // sums list max(listhere) // max min(listhere) // min List Methods: listname.append("NEWITEM") listname.pop() // returns and removes last item of list listname.index("ITEMTOSEARCH") // returns index of item "ITEM" in listname // returns false or true if item is in list or not Tuples: // like list but immutable and uses parenthesis instead tupletest = (1,2,2,2)

2. Python - Basics

Commenting: # hello ## hello If/Else: if x==0:          do elif x < 0:          do else:          do Logics:     & // and     ^ // exclusive OR, one or other but not both     += // increment     -= // decrement

1. Python - Functions

Function Syntax def functionname(args,args):          do something def functionname(arg,arg):          do something          return Functions with Optional Args: def functionname(VAR="hello"):          print("HEY",VAR) // calling functionname(VAR="NOTHELLO) or functionname("NOTHELLO") overrides the VAR Docstrings // descriptions to explain function def functionname():     """this is a description.     >>> test     """ // use help(functionname) to get description Placeholder line def functionname():          pass // placeholder

36. Data Analytics - Google Data Analytics Capstone Case Study - Week 4

Image
 Update resume: Education Google Data Analytics Certificate, Coursera 2021 Skills:     - data analysis     - data cleaning     - data visualization     - R programming     - data-driven decision making     - calculation and analysis in SQL and spreadsheet     - effective presentations Summary: Additional Resources: https://biginterview.com/ https://googlecerts.biginterview.com/ https://googlecerts.courserajobplatform.org/profiles/sign_up

35. Data Analytics - Google Data Analytics Capstone Case Study - Week 3

 Sharing your portfolio and case study. Definitions: Elevator pitch // a short statement describing an idea or concept Tips: Remember your audience and what they're interested in. In portfolio, focus on process more than results. Use case studies to highlight your skills. Build a network. Interview process:     1. Introduction (resume and portfolio) // assess your  background     2. The skill test interview (case study) // test SQL and programming skills on a case study     3. The compatibility interview (optional) // checks if you can work with team members     4. Decision-making // hiring decision step. takes 4-6 weeks. Tips for interview success:          1. Find connections between the job listing and your resume          2. Focus on data // use PAR (problem, action, result) and XYZ (accomplished, measured by, by                doing)          3. Look back at past work experiences // understand what you do to answer experience questions          4. Come ready with questions Int

34. Data Analytics - Google Data Analytics Capstone Case Study - Week 2

 Pick a track to make a case study. Track 1:     Demonstrate job skills for future interviews Track 2:     Flexible portfolio piece about a personal interest Additional Resources: https://medium.com/search https://github.com/search http://public.tableau.com/ https://www.kaggle.com/

33. Data Analytics - Google Data Analytics Capstone Case Study - Week 1

  Definitions : Case study // a common way for employers to assess job skills and gain insight into how you approach common data related challenges Tips:     - make sure the case study answers the question being asked     - make sure that you're communicating the steps you've taken and the assumptions you've made about          the data     - the best portfolios are personal, unique, and simple     - make sure that your portfolio is relevant and presentable What to include in portfolio:          - Biography // an intro to make audience want to know and meet you          - Contact Page // all contact information for audience to contact          - Resume // your resume          - Accomplishments // career-worthly highlights, certificates, events attended, blogs posted          - An image of you (optional) What to include in a case study:          -  Introduction:                      Make sure to state the purpose of the case study.                      This includes what the

32. Data Analytics - Data Analysis with R Programming - Week 5

Image
 Learn how to document and report your work using R markdown. How to install R Markdown in RStudio and create a markdown document. Learn structure and component of the document. Definitions : R Markdown // a file format for making dynamic documents with R Markdown // a syntax for formatting plain text files R Notebook // lets users run your code and show the graphs and charts that visualize the code HTML // set of markup symbols or codes used to create a webpage Jupiter notebooks // documents that contain computer code and rich text elements, such as comments, links, or descriptions of your analysis and results. YAML // language for data that translates it so it's readable Code chunk // code added in an .RMD file. The R markdown file Delimiter // character that indicates the beginning or end of a data item Other Notebooks:          - Project Jupyter, Kaggle, Google Colab           https://jupyter.org/           https://realpython.com/jupyter-notebook-introduction/           https:/

31. Data Analytics - Data Analysis with R Programming - Week 4

 Visualizing in R, using ggplot2 of tidyverse. Base R, and other packages like plotly and RGL can do basic visuals. Definitions : Aesthetic (R) // a visual property of an object in your plot. Size, shape, color. Geom (R) // the geometric object used to represent your data Facets (R) // let you display smaller groups, or subsets, of your data. can create separate graphs for every data in dataset Labels and annotations (R) // lets you customize your plot. Titles, annotations, subtitles, etc Mapping (R) // matching up a specific variable in your dataset with a specific aesthetic Annotate // to add notes to a document or diagram to explain or comment upon it Popular visual packages:          - ggplot2                     - Plotly          - Lattice                     - RGL          - Dygraphs                - Leaflet          - Highcharter           - Patchwork          - gganimate                - ggridges Benefits of ggplot2:          - Create different types of plots          - Customi

30. Data Analytics - Data Analysis with R Programming - Week 3

Image
Learning how to clean data in R. Definition : Data frame // a collection of columns. Like a spreadsheet with column name and rows and cells. Tibbles (Tidyverse) // are like streamlined data frames Tidy data (R) // way of standardizing the organization of data within R Anscombe's quartet // four datasets that have nearly identical summary statistics          - install.packages('Tmisc')          - library(Tmisc)          - install.packages("datasauRus") Analyzing Bias:          - install.packages("SimDesign")          - library(SimDesign)          - bias(firstdataset, seconddataset) // 1st must be actual, 2nd must be prediction                    - unbiased is closer to 0.                    - function determines how much the actual outcome is greater than predicted outcome          - cor(data1,data2) // shows correlation          - sd(x) // shows standard deviation  Manually Create a Data Frame:          - data.frame(vector/list name a, vector/list name b