i want to Create a function that takes in two lists named keys and values as arguments and return a dataframe , example:create_dataframe(["One", "Two"], [["X", "Y"], ["A", "B"]]) -> should return a dataframe
One Two
0 X A
1 Y B
for this purpose i have come with this below code so far(i am learning), but the result is only showing Zero, could anybody please guide me where i am wrong?
import pandas as pd
def create_dataframe(keys,vlaues):
keys = []
values = []
series = pd.Series(keys,index = values)
df = pd.DataFrame(series)
return df.T
create_dataframe(["One", "Two"], [["X", "Y"], ["A", "B"]])