application_vnd.jupyter.stderr_output_1.png
import pandas as pd

path = '/kaggle/input/goodreadsbooks/books.csv'
df = pd.read_csv(path, error_bad_lines=False)

df.shape

def book_search():
    user_choice = int(input('Enter 1 for Author, 2 for Publisher:'))
    match user_choice:
        case 1:
            key = str(input('Enter Author name:'))
            author_list = pd.DataFrame(df[df['authors'] == key]['title'].unique())
            return author_list
        case 2:
            key = str(input('Enter Publisher name:'))
            publisher_list = pd.DataFrame(df[df['publisher'] == key]['title'].unique())
            return publisher_list
        case other:

search_data = pd.DataFrame(book_search())
search_data