[PYTHON] DataNitro, implementation of function to read data from sheet

After studying for a while in private, I left it for a while, but since I installed DataNitro, I've been playing with python for the first time in a while. Since it is DataNitro, implement a function to read data from (excel) sheet.

def get_sheet_data(shtnam, toprow, keyclm, lftclm, rgtclm):
    row = toprow
    while Cell(shtnam, row, keyclm).value != None:
        row += 1
    if row > toprow:
        return CellRange(shtnam, (toprow, lftclm), (row - 1, rgtclm))
    else:
        return []

The place to check until the cell of the column that becomes the key item is empty is vba,

    Range(sheets(shtnam).Cells(toprow, keyclm), _
            sheets(shtnam).Cells(toprow, keyclm)).Select
    Selection.End(xlDown).Select

As you can see in the implementation that references `` `Selection.row```, but with DataNitro There seems to be no other way but to look at each cell one by one. Also, there seems to be no way to access the controls such as the buttons on the seat.

I haven't used python very much, but I found it confusing when I looked up classes. I'll write about this in another article.

Recommended Posts

DataNitro, implementation of function to read data from sheet
[Python] How to read data from CIFAR-10 and CIFAR-100
SIGNATE Quest ② From creation of targeting model to creation of submitted data
The story of copying data from S3 to Google's TeamDrive
From Elasticsearch installation to data entry
Ported from R language of "Sazae-san's rock-paper-scissors data analysis" to Python
How to read e-Stat subregion data
Implementation of login function in Django
Read all the contents of proc / [pid] ~ From setgroups to wchan ~
How to avoid duplication of data when inputting from Python to SQLite.
Read all the contents of proc / [pid] ~ From cwd to loginuid ~
Read all the contents of proc / [pid] ~ From map_files to numa_maps ~
Read all the contents of proc / [pid] ~ From oom_adj to sessionid ~
Read all the contents of proc / [pid] ~ from attr to cpuset ~
Transfer floating point data from Python to JavaScript without loss of digits
[Deep Learning from scratch] Layer implementation from softmax function to cross entropy error
Python vs Ruby "Deep Learning from scratch" Chapter 4 Implementation of loss function
SIGNATE Quest ① From data reading to preprocessing
Acquisition of plant growth data Acquisition of data from sensors
From Attention of Zero Tsuku 2 to Transformer
I read the implementation of golang channel
Summary of vtkThreshold (updated from time to time)
Read the implementation of ARM global timer
How to handle time series data (implementation)
How to read problem data with paiza
Introduction to Scapy ① (From installation to execution of Scapy)
[Introduction to Data Scientists] Basics of Python ♬
Books on data science to read in 2020
[Python] From morphological analysis of CSV data to CSV output and graph display [GiNZA]
Summary of how to read numerical data with python [CSV, NetCDF, Fortran binary]
I tried to make a function to retrieve data from database column by column using sql with sqlite3 of python [sqlite3, sql, pandas]
Summary of gcc options (updated from time to time)
Convert data with shape (number of data, 1) to (number of data,) with numpy.
[Ansible installation procedure] From installation to execution of playbook
How to create a function object from a string
I read the implementation of range (Objects / rangeobject.c)
[Kaggle] From data reading to preprocessing and encoding
[Learning memo] Deep Learning from scratch ~ Implementation of Dropout ~
Use decorators to prevent re-execution of data processing
Data preprocessing (2) Data is changed from Categorical to Numerical.
OpenFOAM post-processing cheat sheet (updated from time to time)
Change the decimal point of logging from, to.
Data retrieval from MacNote3 and migration to Write
[Python] Flow from web scraping to data analysis
I want to get League of Legends data ③
I want to get League of Legends data ②
Detect General MIDI data from large amounts of MIDI
How to read time series data in PyTorch
[Introduction to cx_Oracle] (5th) Handling of Japanese data
I want to get League of Legends data ①
From the introduction of pyethapp to the execution of contract
The transition of baseball as seen from the data
The story of moving from Pipenv to Poetry
Simple implementation example of one kind of data augmentation
[AWS] Migrate data from DynamoDB to Aurora MySQL
Example of application of Python to engineering: Finding parameters of approximate calculation formula from actual data
Try to create a battle record table with matplotlib from the data of "Schedule-kun"
[Scientific / technical calculation by Python] Plot, visualization, matplotlib of 2D data read from file