https://realpython.com/beautiful-soup-web-scraper-python/
Beautiful Soup 4 website: https://www.crummy.com/software/BeautifulSoup/bs4/doc/
Sometimes there might be a need to create a new WordPress admin user via database. For example, when the only admin user is accidentally locked out or in new installations where the admin user is not yourself.
Here are the steps:
Sometimes a binary column’s True-vs-False value is differentiated by a fixed value vs NaN. For example:
Is Good
=============
Is Good
NaN
Is Good
Is Good
NaN
.
.
NaN
In this case, there might be value in converting the values in the column to ones and zeros.
def convert_to_1_0(list_of_column_names, data, inplace = False):
df = data if inplace else data.copy()
for col_name in list_of_column_names:
df.loc[df[col_name].notnull(), col_name] = 1
df.loc[df[col_name].isnull(), col_name] = 0
df = df.astype({col_name:int})
if not inplace:
return df
Note: inplace=True doesn’t work in the code above. Use inplace=False instead.
Source: https://machinelearningmastery.com/selectively-scale-numerical-input-variables-for-machine-learning/
Good article on using pipelines and column transformers.
A very good starting article using pytest
.
Source: https://towardsdatascience.com/unit-testing-for-data-scientists-dc5e0cd397fb