Word example 2 |
---|
aaa |
bbb |
ccc |
ddd |
radioname_maker
#Import required libraries
#No need for os if you don't specify a working directory below
import random, os
import pandas as pd
#Specifying a working directory(If necessary)
path = "Enter a working directory if needed"
os.chdir(path)
#pandas.Load Excel into Dataframe
df_f = pd.read_excel("first_part.xlsx", header=0, na_values=0)
df_f_part = [f_p for f_p in df_f.iloc[:, 0]]
df_s = pd.read_excel("second_part.xlsx", header=0, na_values=0)
df_s_part = [s_p for s_p in df_s.iloc[:, 0]]
#Choose one word from each of the two Excels you read
first_choice = random.choice(df_f_part)
second_choice = random.choice(df_s_part)
#Join
radio_name = first_choice + second_choice
#Output to console
print(radio_name)
Recommended Posts