Answer the question
In order to leave comments, you need to log in
How to tell pandas the correct sequence of elements in a list?
There is such a code (sorry for the length, I know that it is not according to pep8):
data_designation = ["Дата заключения", "Валюта", "Код финансового инструмента", "Операция", "Количество", "Цена", "Объём сделки"]
securities_transactions = pandas.read_excel(file_location, usecols = data_designation, dtype = {data_designation[0]: str, data_designation[1]: str, data_designation[2]: str, data_designation[3]: str, data_designation[4]: float, data_designation[5]: float, data_designation[6]: float}).values.tolist()
Answer the question
In order to leave comments, you need to log in
usecols: int, str, list-like, or callable default None
If None, then parse all columns.
If str, then indicates comma separated list of Excel column letters and column ranges (e.g. “A:E” or “A,C,E:F”). Ranges are inclusive of both sides.
If list of int, then indicates list of column numbers to be parsed.
If list of string, then indicates list of column names to be parsed.
New in version 0.24.0.
If callable, then evaluate each column name against it and parse the column if the callable returns True.
Returns a subset of the columns according to behavior above.
data_designation = ["Дата заключения", "Валюта", "Код финансового инструмента", "Операция", "Количество", "Цена", "Объём сделки"]
securities_transactions = pandas.read_excel(file_location, usecols = data_designation)
securities_transactions = securities_transactions[data_designation]
securities_transactions = securities_transactions.values.tolist()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question