File size: 514 Bytes
6560820
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import pandas as pd

def read_md_files_from_doctors():
    doctors_folder = 'doctors'
    data = []

    for filename in os.listdir(doctors_folder):
        if filename.endswith('.md'):
            file_path = os.path.join(doctors_folder, filename)
            with open(file_path, 'r', encoding='utf-8') as file:
                content = file.read()
                data.append({'filename': filename, 'content': content})

    df = pd.DataFrame(data)
    return df

# Example usage