|
# -*- coding: utf-8 -*-
import numpy as np
import pandas
source_df = pandas.read_excel("2.xlsx", header=None, index_col=0)
result_df = source_df.applymap(lambda x: x if 4 <= float(x) <= 6 else np.nan)
result_df.dropna(inplace=True, how='all', axis=1)
result_df.to_excel("1.xlsx", header=False)
|
|