Repo for storing codes for "100 Days of Code - The Complete Python Pro Bootcamp for 2021" Udemy course by Dr. Angela Yu
- Hello World: https://replit.com/@yanjun91/day-1-printing-start
- Exercise 1: https://replit.com/@yanjun91/day-1-1-exercise
- Exercise 2: https://replit.com/@yanjun91/day-1-2-exercise
- Exercise 3: https://replit.com/@yanjun91/day-1-3-exercise
- Exercise 4: https://replit.com/@yanjun91/day-1-4-exercise
- Band Name Generator Project: https://replit.com/@yanjun91/band-name-generator-start
print()
andinput()
functions- concatenating strings and using
\n
as a way to break line - simple debugging
- NameError exception
- start: https://replit.com/@yanjun91/day-2-start
- Exercise 1: https://replit.com/@yanjun91/day-2-1-exercise
- Exercise 2: https://replit.com/@yanjun91/day-2-2-exercise
- Exercise 3: https://replit.com/@yanjun91/day-2-3-exercise
- Tip Calculator Project: https://replit.com/@yanjun91/tip-calculator-start
- Use
**
as exponential - Use
type()
to check data type - Type casting (eg.:
str()
,int()
,float()
) - TypeError exception
- Using floor division
//
to calculate floor value inint
type (eg.:8 // 3
output is 2 instead of 2.666..) - Shorthand operators (eg.:
x += 1
equals tox = x + 1
) - f string format able to auto cast various data types into string (eg.:
print(f"Your score is {score})
where score is a variable inint
data type) - Mathematics functions (eg.:
round(2.34567, 2)
become2.35
, howeverround(2.3, 2)
will still be2.3
) - Using
{number:.2f}
in f-string to round off and format to 2 decimal places even the number to be round off has lesser decimal places- Where:
- : introduces the format spec
- 0 enables sign-aware zero-padding for numeric types
- .2 sets the precision to 2
- f displays the number as a fixed-point number
- Where:
- start: https://replit.com/@yanjun91/day-3-start
- Exercise 1: https://replit.com/@yanjun91/day-3-1-exercise
- Exercise 2: https://replit.com/@yanjun91/day-3-2-exercise
- Exercise 3: https://replit.com/@yanjun91/day-3-3-exercise
- Exercise 4: https://replit.com/@yanjun91/day-3-4-exercise
- Exercise 5: https://replit.com/@yanjun91/day-3-5-exercise
- Treasure Island Project: https://replit.com/@yanjun91/treasure-island-start
- Indentation is important to let Python know which code is under which block
- Modulo operation will result in the remainder of a division. (eg.:
2%3
is equal to 1) - if/elif/else
- logical operators
- convert to lowercase characters using
.lower()
(eg.:"Yan Jun".lower()
becomesyan jun
) - count a character in string using
.count()
. Note that it is case sensitive. (eg.:"Yan Jun".count("a")
is equal to 1) - Using
'''
to wrap around multi-line strings to be printed out
- start: https://replit.com/@yanjun91/day-4-start
- Exercise 1: https://replit.com/@yanjun91/day-4-1-exercise
- Exercise 2: https://replit.com/@yanjun91/day-4-2-exercise
- Exercise 3: https://replit.com/@yanjun91/day-4-3-exercise
- Rock Paper Scissors Game Project: https://replit.com/@yanjun91/rock-paper-scissors-start
- Creating/using modules
- Generating random integers and float
- IndexError
- Using flow chart to visualize the logic flow before start coding for better implementation
- start: https://replit.com/@yanjun91/day-5-start
- Exercise 1: https://replit.com/@yanjun91/day-5-1-exercise
- Exercise 2: https://replit.com/@yanjun91/day-5-2-exercise
- Exercise 3: https://replit.com/@yanjun91/day-5-3-exercise
- Password Generator Project: https://replit.com/@yanjun91/password-generator-start
- for loops
- use
range(begin, end, [step])
, where the end number is not included, to loop instead of a list - using
random.choice(list)
andrandom.shuffle(list)
- start: https://replit.com/@yanjun91/day-6-start
- Exercise 1: https://reeborg.ca/reeborg.html?lang=en&mode=python&menu=worlds%2Fmenus%2Freeborg_intro_en.json&name=Hurdle%201&url=worlds%2Ftutorial_en%2Fhurdle1.json
- Exercise 2: https://reeborg.ca/reeborg.html?lang=en&mode=python&menu=worlds%2Fmenus%2Freeborg_intro_en.json&name=Hurdle%202&url=worlds%2Ftutorial_en%2Fhurdle2.json
- Exercise 3: https://reeborg.ca/reeborg.html?lang=en&mode=python&menu=worlds%2Fmenus%2Freeborg_intro_en.json&name=Hurdle%203&url=worlds%2Ftutorial_en%2Fhurdle3.json
- Exercise 4: https://reeborg.ca/reeborg.html?lang=en&mode=python&menu=worlds%2Fmenus%2Freeborg_intro_en.json&name=Hurdle%204&url=worlds%2Ftutorial_en%2Fhurdle4.json
- Defining and calling functions
- Reeborg challenge: https://reeborg.ca/reeborg.html?lang=en&mode=python&menu=worlds%2Fmenus%2Freeborg_intro_en.json&name=Alone&url=worlds%2Ftutorial_en%2Falone.json
- Test your logic thinking and problem solving skills accomplishing some movements like turn right using available function turn_left() together with some loops to reach the goal
- Challenge 1: https://replit.com/@yanjun91/Day-7-Hangman-1-Start
- Challenge 2: https://replit.com/@yanjun91/Day-7-Hangman-2-Start
- Challenge 3: https://replit.com/@yanjun91/Day-7-Hangman-3-Start
- Challenge 4: https://replit.com/@yanjun91/Day-7-Hangman-4-Start
- Challenge 5: https://replit.com/@yanjun91/Day-7-Hangman-5-Start
- Replit module package: https://github.com/replit/replit-py
- Reminded to draw a flowchart before starting to code a complex solution
- Code the solution one step at a time instead of doing it all in once and debug later which may caused longer time to fix
- Add a print statement while coding to test
- Use
if 'x' in string
to check for characterx
in astring
- creating and importing modules
- start: https://replit.com/@yanjun91/day-8-start
- Exercise 1: https://replit.com/@yanjun91/day-8-1-exercise
- Exercise 2: https://replit.com/@yanjun91/day-8-2-exercise
- Cipher Encryption Project part 1: https://replit.com/@yanjun91/caesar-cipher-1-start
- Cipher Encryption Project part 2: https://replit.com/@yanjun91/caesar-cipher-2-start
- Cipher Encryption Project part 3: https://replit.com/@yanjun91/caesar-cipher-3-start
- Cipher Encryption Project part 4: https://replit.com/@yanjun91/caesar-cipher-4-start
- Definition of parameters and argument
- parameter is the variable used to accepts value in function (i.e.:
name
indef greet(name)
) - argument is the value passed in when calling function (i.e.:
greet("Yan Jun")
where "Yan Jun" is the argument)
- parameter is the variable used to accepts value in function (i.e.:
- Positional argument is argument that we passed into function in the order
- Keyword argument is used to specified which parameter that the argument should assigned to
- Using modulus to loop within the length of list to ensure index wont go out of bound
- start: https://replit.com/@yanjun91/day-9-start
- Exercise 1: https://replit.com/@yanjun91/day-9-1-exercise
- Exercise 2: https://replit.com/@yanjun91/day-9-2-exercise
- Blind Auction Project: https://replit.com/@yanjun91/blind-auction-start
- Dictionary is a list of key-value pairs where the key can be of any primitive type like string or int
- Nesting of dictionaries and/or lists within another dictionary/list
- Using for loop on dictionary yields key instead of its value
- start: https://replit.com/@yanjun91/day-10-start
- Exercise 1: https://replit.com/@yanjun91/day-10-1-exercise
- Calculator project: https://replit.com/@yanjun91/calculator-start
-
Can have multiple return statements in a function but only one that is first processed runs
-
Use docstrings to document the function which then will be shown as a description of function when autocomplete
- To add docstrings, surround the description using
"""
that is typed directly after definition of function, within the function's code block. """
can be used as multiline comments as well but not recommended
- To add docstrings, surround the description using
-
Function can be used as values in dictionary. We can then used it as describe below:
- Define a function
def my_function(x, y): return z
- Define dictionary
dict = { "function": my_function }
- Use the function in dictionary
function = dict["function"] function(x, y)
-
Recursion: Calling the a function within the same function
- My Solution: https://replit.com/@yanjun91/blackjack-start
- Instructor Solution: https://replit.com/@appbrewery/blackjack-final
- modularize functions for better code organization and easier to manage
- work on functionalities one part at a time
- start: https://replit.com/@yanjun91/day-12-start
- Guess The Number Project: https://replit.com/@yanjun91/guess-the-number-start
- global vs local scope
- no block scope
- ASCII art generator: http://patorjk.com/software/taag/
- start: https://replit.com/@yanjun91/day-13-start
- Exercise 1: https://replit.com/@yanjun91/day-13-1-exercise
- Exercise 2: https://replit.com/@yanjun91/day-13-2-exercise
- Exercise 3: https://replit.com/@yanjun91/day-13-3-exercise
- Use print or debugger to debug your code
- Higher Lower Game Project: https://replit.com/@yanjun91/higher-lower-start-1
- Breaking down large task into smaller chunks and tackle them one by one
- Properly go through requirement before start to code.
- Object Oriented Programming = OOP
- An object has attributes and methods
- Go to pypi.org to see all available modules
- Using prettytable module to pretify table
- Use PascalCase for class name and snake_case for variables
- constructor name is
def __init__(self):
- Try to only accepts input from caller in methods in class instead of doing something like accessing items in list directly
- Read documentation to better understand the uses of methods in modules
- Use alias by adding
as
like so,import turtle as t
- Tuple is fixed(a.k.a. immutable) and cant be changed while list can. Use
list(my_tuple)
to convert tuple to list
- Creating different instances so that each of them are acting independently
- using
screen.tracer(0)
together withscreen.update()
andtime.delay(0.1)
to control the refresh rate of the turtle object
- Inheritance. Uses code below to inherit Animal class to Fish class, where super refer to the Animal class. We can also override a method from superclass by defining the same method name in subclass.
class Fish(Animal): def __init__(self): super().__init()
- Slicing. We can get a subset from a list/tuples and assign to another list.
- For example, to get
[c, d, e]
fromalphabets = [a, b, c, d, e, f, g]
, we would use `alphabets[2:5]'. - We can also use
alphabets[2:]
to get[c, d, e, f, g]
- Using
alphabets[:5]
results in getting[a, b, c, d, e]
alphabets[2:5:2]
will get[c, e]
while usingalphabets[::2]
would get[a, c, e, g]
.- Use
alphabets[::-1]
to reverse the list
- For example, to get
- Using
onkeypress()
to continuously move the turtle on holding down a key
- Need to think out of the box in creating solutions
- read, write, append files
- absolute file path starts from root that starts with
/
- relative file path starts with current folder (working directory) that starts with
./
while using../
is one step up to parent directory - Use forward slash regardless of Mac or Windows
- using pandas as a way to go through data structures easily and read/write files
- can add image to turtle window as background but only accepts gif type image
- List comprehension can be used in the format of
new_list = [new_item for item in list]
- Conditional list comprehension can be used in the format of
new_list = [new_item for item in list if test]
- Dictionary comprehension can be used in the format of
new_dict = {new_key:new_value for (key,value) in dict.items()}
- Conditional dictionary comprehension can be used in the format of
new_dict = {new_key:new_value for (key,value) in dict.items() if test}
- loop through data frame using comprehension:
{new_key:new_value for (index, row) in df.iterrows()}
- Using tkinter module to build a GUI
- we can put default value to parameters of function when defining it which renders them optionals
def my_function(a=1, b=2, c=3):
then we can call without pass in any arguments
- we can add unlimited number of arguments by using
*args
as parameter like belowdef add(*args): total = 0 for n in args: total += n return total
- use
**kwargs
as parameter in a function definition as keyword arguments where arguments are in key-value pairdef calculate(n, **kwargs): print(kwargs) n += kwargs["add"] n *= kwargs["multiply"] print(n) calculate(2, add=3, multiply=5)
- We can define our own class constructor with
**kw
.class Car: def __init__(self, **kw): # self.make = kw["make"] # self.model = kw["model"] # Using .get() so that it just return None instead of error if the specific argument not specified when call self.make = kw.get("make") self.model = kw.get("model") my_car = Car(make="Nissan") print(my_car.make)
- the parameter name
args
andkwargs
in*args
and**kwargs
respectively can change to other name. The number of asterisk is the one that determine whether it is a unlimited arguments or keyword argument
- Adding image using canvas
- using
windows.after(1000, some_function, x)
to callsome_function
function withx
as argument after 1 second - dynamic typing concept in python means we can change the type of a variable when we change it, say, from
int
tostr
and it still worka = 4 # int type a = "Hi" # str type # a changes from int type to str type
Entry.delete(0, END)
will clear the entry of string from index 0 to end of string- The code below will yield an input entry of "123yanjun@email.com". The first parameter indicates the index to insert the text. Using
END
will insert to the end of string.email_entry.insert(0, "yanjun@email.com") email_entry.insert(0, "123")
- catch exception syntax format:
try:
# your own logic that might cause exception
except:
# execute logic here if there was an exception
else:
# execute logic here if no exception
finally:
# no matter what happen, execute logic here
- we can raise exception by using
raise
. For example:raise TypeError("This is an error that I made up.")
which includes our own message - Json functions
- Write:
json.dump()
, it will convert into json format as well - Read:
json.load()
, which will serialized into dict type - Update:
json.update()
- Write:
- updating text, image in canvas
- more understanding on using
window.after()
- Sending email using Python through SMTP
- Use
msg="Subject:Hello\n\nThis is the body of my email"
as thesendmail()
parameter to specify the email subject "Hello" and email body by adding\n\n
- Use pythonanywhere to host python code in the cloud
- Use
requests
module to call API - Response codes meaning in plain text:
- 1XX: Hold On
- 2XX: Here You Go
- 3XX: Go Away
- 4XX: You Screwed Up
- 5XX: I Screwed Up
- HTTP Status reference: https://httpstatuses.com/
- We can define data type for the variables/parameter upfront using format
variable: data_type
. For example,age: int
. In class or function, we just put it in parentheses when defining it - We can also define the return type of function using
-> data_type
format. For example,def check_price(price: int) -> bool:
would return a bool type
- Sending SMS alert using Python through Twilio
- Combining all knowledge on calling API and sending SMS to build a small project
- Request types:
- GET: requests.get() => get data from API
- POST: requests.post() => give data to API
- PUT: requests.put() => update data through API
- DELETE: requests.delete() => delete data through API
- Using pixela to track habits through their APIs
- Combined knowledge learnt in previous lessons.
- Go through API documentation for info on how to use the API
- How Internet works
- Basic elements of HTML tags
- Tables, Forms elements
- Can host a website free in github
- Create a repository
- Upload html files
- Go to Settings > Github Pages section
- At Source, choose master branch from the dropdown and click Save.
- It may take some time to publish the website. The link to the website will be shown at the Github Pages section.
- Using inline, internal and external CSS to style HTML pages.
- Different way to style elements in HTML pages by using tags/class/id selectors.
- Box model of div tag
- display block elements takes up the whole width of the page regardless of content, but height still determine by content. However, we can change the width of them using CSS.
- Common block elements:
<p>
,<h1>...<h6>
,<div>
,<ol>
,<ul>
,<li>
and<form>
- Common block elements:
- display inline elements does not take up whole width of page but just the size that it needs only.
- Common inline elements:
<span>
,<img>
and<a>
- Common inline elements:
- inline-block is hybrid of both block and inline. We can change it's width and can put inline with several elements.
- static position is the original position that those elements would be without any css.
- relative position is the position moved from the original static position(aka relative to the original static position). We would generally use relative position with some positioning css property. The element with relative position will not affect other element so it might overlap other element if we move it.
- Example below shows the img element move 30px to the right from it's original static position:
img {
position: relative;
left: 30px;
}
- abosulte position will move its position relative to its parent element. This will affect flow of other elements.
- fixed position will stick to a position relative to its parents even when we scroll the page.
- text-align used in a parent element will center everything for its child elements. Use
margin: 0 auto
to center if block display element has some width. - 100% or 1em font-size is equivalent to 16px. Recommend to use 1rem so that in case parent element as font size set to 2em or more then it wont stack.
- Google font css link import: https://fonts.google.com/
- Free flaticons: https://www.flaticon.com/
- Color palettes: https://colorhunt.co/
- CSS Button creator: https://cssbuttoncreator.com/
- Extra challenge can be done at https://www.frontendmentor.io/
- Using BeautifulSoup module to scrap website
- Reads the robots.txt of the website(if available) to check which pages are allow/disallow to scrap and how long is the delay we should crawl. We can access the file by adding "/robots.txt" after the website root domain.
- Scrap Billboard top 100 tracks and create a Spotify playlist from it.
- Scrap Amazon website to track price fluctuation and email when current price is below target price.
- Using Selenium to automate website testing
- Using Selenium to get certain elements content by id, class, name, css selector(eg: anchor tag within div), etc
- Can use get element by name to fill in forms
- If all else method to get an element wont work, then can use xpath
- We can combine each item from 2 lists into a dict within a list using list comprehension
list = [{"key1": value1, "key2": value2} for value1 in list1 for value2 in list2]
- Save jobs from Linkedin search result automatically using Selenium
- Built a Tinder auto swipe bot
- Built a bot to automatically test Internet speed and tweet when speed not as promised
- Built a bot to automatically follow followers from an Instagram page.
- Built rental web scraping automation using BeautifulSoup to scrap data and Selenium to enter data to Google Form
- Flask and Django is framework for Python on the web backend to process business logic
- Basic unix commands
- Use
rm -rf <FolderName>
: -rf means recursively forcibly. All files and directory inside that folder will be removed.
- Use
__name__
will have the current class/function/method/descriptor/generator name- If we run that specific Python file, then the
__name__
will be__main__
-@app.route('/') is a decorator function. Whatever function definition under it will be triggered with additional functionalities defined in app.route.
- If we run that specific Python file, then the
- Run in debug mode by adding
debug=True
inapp.run()
like so,app.run(debug=True)
- We can specify the path variable to certain data types like int. If that particular variable is of a different type, say string, then it will render as 404 not found.
- html files goes into templates folder
- static files goes into static folder
- can execute a Javascript code in developer tools' console to make the webpage editable on the page itself. Use
document.body.contentEditable=true
- Use Jinja to template webpage content dynamically
- Use
{{ <Python Code> }}
in html file to render python codes - pass in dynamic content using **kwargs in
render_template()
as parameter.render_template("index.html", key=value)
- use {% %} for multiline python code in html file and add {% endfor %} or {% endif %} depending on the code.
- use
{{ url_for('<function_name>') }}
in html file inside href to navigate to the page- we can even add parameters to the
use_for()
method to pass in the params for the URL. For example, if we are to add num as part of the url as params then use this:{{ url_for('<function_name>', num = 3) }}
- we can even add parameters to the
- Using Bootstrap to style web page.
- z-index only takes effect when we use position property
- Hierarchy of applying css styles from most important to least important: inline css > internal css > id > class > elements
- try not to use id unless necessary even if the element only appear once. Use id on sections only.
- bad practice to use inline css style
- Enhanced day 55 blogpost website with bootstrap
- Add POST request functionality to blog's contact me page
- use
request
module from Flask to receive POST/GET request from a form submission
- Use WTForms and Flask-Bootstrap to build page with form with lesser code
- Use WTForms and Flask-Bootstrap work on more exercise to add form submission to save data to csv
- Build a website with sqlite as database and using SQLAlchemy to access the database.
- Create top 10 movies with Flask/SQLAlchemy/WTForms
- Web Design is important to deliver the mood and message as intended.
- Red: Love, Energy, Intensity
- Yellow: Joy, Intellect, Attention
- Green: Freshness, Safety, Growth
- Blue: Stability, Trust, Serenity
- Purple: Royalty, Wealth, Feminity
- Use analogous color (colors besides each other in color palette wheel) works well together. Good for navigation bar and body of website, logo and its background. Not good for standing out.
- Use complementary color (colors opposite each other in color palette wheel) to makes something pop but do not use them as your font color and background color.
- Use sans-serif and serif in title and body in turn. Use Humanist typeface for easier reading.
- Emotion behind fonts
- Serif gives traditional, stable and respectable feels. Use in a more professional settings like letter.
- Sans-serif gives sensible, simple and straightforward mood. Many startup likes to use this in their website.
- Script gives personal, creative and elegant feels.
- Display gives friendly, loud and amusing mood.
- Modern gives stylish, chic and smart feels. Used in style magazines.
- Big item often draws attention. Use it for things that you want to attract attention like Checkout button.
- Layout of website is important. Don't use all words only, add some pictures/different colors and font size. Use 40-60 characters per line for easier eye tracking to read
- Align text properly. Reduce number of alignment points.
- Spacing is important. Luxury store often spaces out their items. If items are cluttered together, it will look like discount store.
- Think about audience and consider design based on them. Children audience will like more colorful design.
- UX:
- Simple
- Consistency
- Reading patterns start left to right but the length to look through from left to right is shorten as user goes down the webpage. Or use Z pattern.
- Design challenges: https://www.dailyui.co/
- Website to create design for free: https://www.canva.com/
- Building REST API using Python with Flask
- Update blog webpage to use sqlite
- Add authentication to a page and encrypt password before store in database.
- Add authentication + password encryption to previous blog post website project.
- Add blog post admin feature
- Add comment feature
- GitHub lessons
- Deploy previous blog website project to Heroku
- Using Pandas DataFrame to do data exploration
.head()
and.tail()
to view the top 5 and bottom 5 rows respectively- Can use
.findna()
to find NaN data and use.dropna()
to drop rows with NaN data - Use
df['column name'][index]
ordf['column name'].loc(index)
to access the column data for that particular index - Use
.max()
and.min()
to get the max or min value for that column(e.g.:df['Salary'].max()
) - Use
.idxmax()
and.idxmin()
to get the max and min index respectively - Use
.sort_values()
to sort the dataframe. Use parameter ascending=False to sort it by descending order - Use
.insert()
to insert column into dataframe. Need to specify the index to insert and the data in array with the same order - Use
.groupby()
to group the rows by columns specified - Google Colaboratory Notebook link: https://colab.research.google.com/drive/1_oNsxiRzdc1tqIrFiiMfSjt_ldB4w6Qt?usp=sharing
- Plotting chart with matplotlib
- can convert string to datetime using
pandas.to_datetime()
for easier plotting - reshaped DataFrame using
.pivot()
- fill in NaN values with 0 in all columns using
.fillna(0, inplace=True)
- using
plot()
with loop to plot multiple lines in chart using "label" parameter inplot()
method - add legend after adding label
- smooth out the line using
.rolling()
and.mean()
- Google Colaboratory Notebook link: https://colab.research.google.com/drive/1B6sxOG4ufmNa-AotFc5PCmvFdUlZl0CI
- Using
df.agg()
to aggregate data - Use
df[:-2]
to slice out the last 2 data in data frame - Use
df.rename()
to rename columns in DataFrame - To create two-axes chart, need to create the axes first then use
.plot()
ax1 = plt.gca() # get current axes
ax2 = ax1.twinx()
- Use
pd.merge()
to merge 2 DataFrame with common key(primary-foreign key):pd.merge(set_theme_count, themes, on='id')
- Google Colaboratory Notebook link: https://colab.research.google.com/drive/1W3UKi7VMVtwbBtpSKy6K0JtyCCySBlsV#scrollTo=cYId5JdnoVyL
- use
.describe()
to quickly see some descriptive statistics at a glance - use
.resample()
to change the period of a time-series chart. The column with date/time need to be first converted to datetime usingpd.to_datetime()
- use linestyles parameter in
.plot()
to change the line styles to something like dashed line or dotted lines - use
.grid()
to draw grids to chart - Google Colaboratory Notebook link: https://colab.research.google.com/drive/1VrYYysKKSY_xitnLI8xr_20tYuWLE2Bj
- Using
.sample(n)
to sample a few random data with n rows - Find duplicated entries using
.duplicated()
and use.drop_duplicates()
to remove duplicated rows. Additional parameters can be entered for more precise removal of duplicates based on columns. - Use
.to_numeric()
to convert to numeric values - Use plotly to ploy pie, donut, bar chart, box plots and scatter plots
- Google Colaboratory Notebook link: https://colab.research.google.com/drive/12FYqAekf0NZu5R2cj9b9egEM938d6rKc
- Create arrays manually using
np.array([1,2,3,4,5])
from NumPy module - Generate array using
.arange()
with specified range and.linspace()
with specified range plus the size of array that has the numbers difference equally spread apart. - analyse multi-dimensional/n-dimensional array(ndarray)
- slice and get subset of ndarray
- scalar and matrix multiplication operation with ndarray
- manipulate color of image that is composed from ndarray
- Google Colaboratory Notebook link: https://colab.research.google.com/drive/1JhImou6hK_hopEyj0qH5ioBIPzMfBDFB
- Filter Pandas DataFrames based on multiple conditions using both .loc[] and .query()
- Create bubble chart using Seaborn module
- Seaborn created bubble chart can be styled using Matplotlib as it Seaborn built upon Matplotlib
- Use floor division to convert years to decades
decades = years//10*10
- Use Seaborn to superimpose a linear regressions over our data
- Run regressions with scikit-learn and calculate the coefficients.
- Google Colaboratory Notebook link: https://colab.research.google.com/drive/1wTVYymYQHe2J1YKu67pnsoNy_wuta4gE
- Create a Choropleth to display data on a map
- Create bar charts showing different segments of the data with plotly
- Create Sunburst charts with plotly
- Google Colaboratory Notebook link: https://colab.research.google.com/drive/1kbTkDNw056iSAIBd4Fgi27QLALu0NiV1#scrollTo=Ml9w1jFjGUTi
- use histograms to visualise distributions
- superimpose histograms on top of each other even when the data series have different lengths
- use a to smooth out kinks in a histogram and visualise a distribution with a Kernel Density Estimate (KDE)
- improve a KDE by specifying boundaries on the estimates
- use scipy and test for statistical significance by looking at p-values
- highlight different parts of a time series chart in Matplotib
- add and configure a Legend in Matplotlib
- Use NumPy's
.where()
function to process elements depending on a condition. - Google Colaboratory Notebook link: https://colab.research.google.com/drive/1qLmI7qJLBZbx2v-PfXvZZpAxLMKNATYf
- A capstone project of data analysis module on Python
- Google Colaboratory Notebook link: https://colab.research.google.com/drive/1u8mFyFxoCbtnnGbgRtrvWBCoTJug8x0z
- Assignments