image_output_5.png image_output_7.png image_output_4.png image_output_8.png image_output_6.png image_output_3.png image_output_2.png image_output_1.png image_output_10.png image_output_9.png
import pandas as pd

metadata_df = pd.read_csv('../input/CORD-19-research-challenge/metadata.csv', index_col='cord_uid')

example_df = pd.read_csv('../input/CORD-19-research-challenge/Kaggle/target_tables/2_relevant_factors/How does temperature and humidity affect the transmission of 2019-nCoV.csv')

example_shas = []
example_uids = []
for index, row in example_df.iterrows():
    study_title = row['Study']
    study_metadata = metadata_df[metadata_df['title'] == study_title]
    if len(study_metadata) != 0:
        sha = study_metadata.iloc[0]['sha']
        uid = study_metadata.iloc[0].name
        if str(sha) != 'nan':
            example_shas.append(sha)
            example_uids.append(uid)

unique_example_uids = set(example_uids)
len(unique_example_uids)

embeddings_df = pd.read_csv('../input/CORD-19-research-challenge/cord_19_embeddings_4_24/cord_19_embeddings_4_24.csv', header=None, index_col=0)

available_uids = unique_example_uids.intersection(embeddings_df.index)
example_embeddings_df = embeddings_df.loc[available_uids]

feature_pop_means = embeddings_df.mean(0)

informative_embeddings_df = embeddings_df.loc[:, p_vals < 0.05 / len(p_vals)]

informative_embeddings_df