Files
kadastr14/check_fix.py
2025-08-12 23:53:44 +05:00

25 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import pandas as pd
df = pd.read_excel('test_fix.xlsx')
print('Проверяем данные в Excel:')
print('Всего строк:', len(df))
filled = df[df['Найден в файле'].notna() & (df['Найден в файле'] != '')]
print('Заполненных строк:', len(filled))
if len(filled) > 0:
for i, (idx, row) in enumerate(filled.head(3).iterrows()):
print(f'Строка {i+1}:')
print(f' Номер в Excel: {row.iloc[0]}')
main_num = row['Основной номер объекта']
additional = row['Дополнительные номера']
print(f' Основной: {main_num}')
print(f' Дополнительные: {additional}')
# Проверяем, что основной номер не дублируется
if pd.notna(main_num) and pd.notna(additional):
main_in_additional = str(main_num) in str(additional)
print(f' ✅ Основной номер НЕ повторяется в дополнительных: {not main_in_additional}')
print()
else:
print('Не найдено заполненных строк')