Q: Pythonic way to get rows AND columns in Pandas Dataframe which contains NaN values Considering the following Pandas DataFrame:
      |  val1 | val2 | val3 | val4
------------------------------------
  'a' |   1   | NaN  | NaN  | NaN
  'b' |  12   |  5   | NaN  | 4
  'c' |   3   |  6   | NaN  | NaN
  'd' |   4   |  7   | 6    | NaN
  'f' |   1   |  8   | 7    | 10

How could I get the rows and columns where there is a Nan values. I've looking for hours but all the questions, answers and blogs are about getting all the rows or all the columns which contains NaN values.
I've made the following code:
row_has_NaN = df.isnull().any(axis=1)
rows_list = df[row_has_NaN].index.values  # Rows
for row in rows_list:
    print(row)
    row_series = df.loc[row]
    columns_has_NaN = row_series.isnull()
    columns_list = row_series[columns_has_NaN].index.values  # Columns by Row
    to_print = '\n\t'.join(columns_list)
    print(f"\t{to_print}")

So I get:
a
    val2
    val3
    val4
b
    val3
c
    val3
    val4
d
    val4

But I was wondering whether there is a more Pythonic or cleaner way to do that. Thanks in advance

A: We have stack after isna
s = df.isna().stack().loc[lambda x : x]
Out[75]: 
'a'  val2    True
     val3    True
     val4    True
'b'  val3    True
'c'  val3    True
     val4    True
'd'  val4    True

You can also add reset_index at the end
#df.isna().stack().loc[lambda x : x].reset_index()

