Feature name extraction directly from dataset I would like to visualize my features using the code below. However, I am getting an error that my features are being recognized as "nan" instead of their actual names.

Instead of the below Feature = [and then writing the features that I want], I am assigning  feature = data [0,1:]. This is the first row of my data that has the features in it. I have many features that I don't want to write as string but would just like to extract from the data file directly. How can I do this and get the names of the features instead of 'nan'?

# Load the dataset
data = load_data('credit')

# Specify the features of interest
features = [
        'limit', 'sex', 'edu', 'married', 'age', 'apr_delay', 'may_delay',
        'jun_delay', 'jul_delay', 'aug_delay', 'sep_delay', 'apr_bill', 'may_bill',
        'jun_bill', 'jul_bill', 'aug_bill', 'sep_bill', 'apr_pay', 'may_pay', 'jun_pay',
        'jul_pay', 'aug_pay', 'sep_pay',
    ]

# Extract the instances and target
X = data[features]
y = data.default


from yellowbrick.features import Rank1D

# Instantiate the 1D visualizer with the Sharpiro ranking algorithm
visualizer = Rank1D(features=features, algorithm='shapiro')

visualizer.fit(X, y)                # Fit the data to the visualizer
visualizer.transform(X)             # Transform the data
visualizer.poof()                   # Draw/show/poof the data
If you are reading in a csv, try;

data = pd.read_csv('filepath', header=None)


Then you can do what you were doing to read the features from the first line