Get all dates between two dates inclusive in Python
If you want to print out a list of all dates between 2 dates (a date range), then you can use the following script:
from datetime import date, …
Read Article →
320 articles about python development, tools, and best practices
If you want to print out a list of all dates between 2 dates (a date range), then you can use the following script:
from datetime import date, …
Read Article →
If you want to append a Python dictionary to a Pandas DataFrame, you can do this:
# Create a new DataFrame
output = pd.DataFrame()
# Append the …
Read Article →
You can store secrets in AWS Secret Manager and reference their ARN in AWS Systems Secret Manager.
The below snippet allows you to specify the …
Read Article →Implement a function that adds two numbers together and returns their sum in binary. The conversion can be done before or after the …
Read Article →You have successfully written your pandas Dataframe to an Excel file, but when you open it, all the columns are squashed up against each other.
There …
Read Article →You will be given an array of numbers. You have to sort the odd numbers in ascending order while leaving the even numbers at their …
Read Article →Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats or …
Read Article →Implement the function unique_in_order which takes as argument a sequence and returns a list of items without any elements with the same …
Given a string, replace every letter with its position in the alphabet.
If anything in the text isn’t a letter, ignore it and …
Read Article →You are given a string of space-separated numbers and have to return the highest and lowest number.
Example:
high_and_low("1 2 3 4 …
Read Article →
Implement a difference function, which subtracts one list from another and returns the result.
It should remove all values from list a, …
Given an integer numRows, return the first numRows of Pascal’s triangle.
In Pascal’s triangle, each number is the sum of the …
Read Article →