ValueError: Found input variables with inconsistent numbers of samples: [13366, 1735 import numpy as np
import tensorflow as tf
import pandas as pd


from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import OrdinalEncoder
from sklearn.model_selection import train_test_split



def import_data():
    pulstars = pd.read_csv("pulsar_stars.csv", index_col=0)
    x = pulstars[["Standard deviation of the integrated profile", "Excess kurtosis of the integrated profile","Skewness of the integrated profile","Mean of the DM-SNR curve","Standard deviation of the DM-SNR curve","Excess kurtosis of the DM-SNR curve","Skewness of the DM-SNR curve"]]
    y = pulstars[["target_class"]]

    return x,y

inp , out = import_data()

out = out.dropna()

#normalize data
scaler = MinMaxScaler()
inp = scaler.fit_transform(inp)
out = scaler.fit_transform(out)

classConverter = OneHotEncoder(sparse=False)
out = classConverter.fit_transform(out)

layer = {
    "input": 8,
    "hidden": 8,
    "output": 2
}

i_h = {
    "weight": tf.Variable(tf.random_normal( [ layer["input"] , layer["hidden"] ] )),
    "bias": tf.Variable(tf.random_normal([layer["hidden"]]))
}

# weight = {
#     "i_h":tf.Variable(tf.random_normal( [ layer["input"] ], [ layer["hidden"] ] )),
#     "h_o":tf.Variable(tf.random_normal([[layer["hidden"]],[layer["output"]]]))
# }

# bias = {
#     "i_h":tf.Variable(tf.random_normal([layer["hidden"]])),
#     "h_o":tf.Variable(tf.random_normal([layer["output"]]))
# }

h_o = {
    "weight": tf.Variable(tf.random_normal([layer["hidden"],layer["output"]])),
    "bias": tf.Variable(tf.random_normal([layer["output"]]))
}



inp_dataset = tf.placeholder(tf.float32, [None, layer["input"]] )
target = tf.placeholder(tf.float32, [None, layer["output"]])

def feed_forward(inp_dataset):
    x1 = tf.matmul(inp_dataset,i_h["weight"]) + i_h["bias"]
    y1 = tf.nn.sigmoid(x1)

    x2 = tf.matmul(y1,h_o["weight"]) + h_o["bias"]
    y2 = tf.nn.sigmoid(x2)

    return y2 #output

output = feed_forward(inp_dataset)

error = tf.reduce_mean(0.5 * (target - output) ** 2)

#back propagation (update weight &amp; bias)
update = tf.train.GradientDescentOptimizer(0.2).minimize(error)


#split dataset
x_train, x_test, y_train, y_test = train_test_split(inp, out, test_size = 0.2)


and this happen

ValueError                                Traceback (most recent call last)
&lt;ipython-input-12-48df591e9215&gt; in &lt;module&gt;()
     79 
     80 #split dataset
---&gt; 81 x_train, x_test, y_train, y_test = train_test_split(inp, out, test_size = 0.2)
     82 
     83 

2 frames
/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py in check_consistent_length(*arrays)
    210     if len(uniques) &gt; 1:
    211         raise ValueError("Found input variables with inconsistent numbers of"
--&gt; 212                          " samples: %r" % [int(l) for l in lengths])
    213 
    214 

ValueError: Found input variables with inconsistent numbers of samples: [13366, 1735]
After you apply dropna on your out, some rows are removed but the same is not done for your input. Hence, they have different number of rows, leading to your error.