0

I am pretty new to python/esp pycharm and some of its popular packages, but I"m not sure why the below code won't return the pandas dataframe that I intended for. For background, I downloaded a poker dataset but when I return the code shown I just don't get any output. Any help would be appreciated:

import pandas as pd
import numpy as np

def print_poker_hand_testing_data():

    poker_hand_data = pd.read_fwf("/Users/satbi/PycharmProjects/poker_analyzer/venv/poker data/poker-hand-testing.data")
    print(poker_hand_data.to_string())

def print_poker_hand_training_true_data():
    poker_hand_training =      pd.read_fwf("/Users/satbi/PycharmProjects/poker_analyzer/venv/poker data/poker-hand-training-true.data")
    print(poker_hand_training.to_string())

    if __name__ == '__main__':
        print_poker_hand_testing_data()
Grismar
  • 27,561
  • 4
  • 31
  • 54
sahb
  • 1
  • 1
  • 1
    Without adjusting your indentation, it looks like you simply indented the last two lines to become part of the function. Unindent them and your code should run - keep in mind that in Python, indentation is meaningful. – Grismar Feb 03 '23 at 05:47
  • 1
    `if __name__ == '__main__'` change indent for this block. –  Feb 03 '23 at 05:48

0 Answers0