Skip to content

Instantly share code, notes, and snippets.

@siddharththakur26
Created May 9, 2020 16:25
Show Gist options
  • Save siddharththakur26/77b3f59a346bedc5e69b4b61297e45ad to your computer and use it in GitHub Desktop.
Save siddharththakur26/77b3f59a346bedc5e69b4b61297e45ad to your computer and use it in GitHub Desktop.
TestDome-DataScience
import pandas as pd
import numpy as np
def login_table(id_name_verified, id_password):
"""
:param id_name_verified: (DataFrame) DataFrame with columns: Id, Login, Verified.
:param id_password: (numpy.array) Two-dimensional NumPy array where each element
is an array that contains: Id and Password
:returns: (None) The function should modify id_name_verified DataFrame in-place.
It should not return anything.
"""
id_name_verified.drop(['Verified'],axis=1,inplace=True)
for row in id_name_verified.itertuples(index=True):
id_name_verified.at[row.Index,'Password'] = id_password[row.Index,1]
pass
id_name_verified = pd.DataFrame([[1, "JohnDoe", True], [2, "AnnFranklin", False]], columns=["Id", "Login", "Verified"])
id_password = np.array([[1, 987340123], [2, 187031122]], np.int32)
login_table(id_name_verified, id_password)
print(id_name_verified)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment