There is an excel file, countries are abbreviated in it in a column:
CA US US ... How to display the excel file in which the number will be written in the first column, and in the second the abbreviated name from this country?
There is an excel file, countries are abbreviated in it in a column:
CA US US ... How to display the excel file in which the number will be written in the first column, and in the second the abbreviated name from this country?
Option using the Pandas module:
import pandas as pd # pip install pandas input_fn = r'C:\download\Task.xlsx' output_fn = r'c:\temp\result.xlsx' df = pd.read_excel(input_fn, header=None, skiprows=[156], names=['device_id', 'country', 'install_time']) # расчет количества строк по странам и запись в Excel (df.groupby('country') .size() .reset_index(name='count') .to_execl(output_fn)) Source: https://ru.stackoverflow.com/questions/938366/
All Articles