datatable

Duplicate pairs of rows side by side in pandas given certain condition

Duplicate pairs of rows side by side in pandas given certain condition Question: I have the following code: import pandas as pd data = { ‘Col1’: [‘John 1’, ‘John 2’, ‘John 3’, ‘Kyle 1’, ‘Kyle 3’, ‘Kyle 2’], ‘Col2’: [‘B’, ‘C’, ‘E’, ‘F’, ‘F’, ‘S’], ‘Col3’: [‘1’, ‘1’, ‘1’, ‘1’, ‘1’, ‘2’] } df = …

Total answers: 4

How can I transform multiple columns in a table to list

How can I transform multiple columns in a table to list Question: How can I transform Tab 1 to Tab2 df = pd.DataFrame({‘A’: [3, 5], ‘B’: [4, 6], ‘Z’: [6, 8]}, index=[1, 100]) I suppose pandas df.melt might help, but I’m not sure Asked By: aeti || Source Answers: Use DataFrame.melt with add index values …

Total answers: 2

Can not get DataFrame to pivot

Can not get DataFrame to pivot Question: Im am getting data from a tablue worksheet and passing it into a Pandas Data Frame i the need to Pivot the data to be in the needed format how ever does not seem to be changing when run C Week Measure Names NT Login Site Measure Values …

Total answers: 1

How to implement datatable server side from this code using django

How to implement datatable server side from this code using django Question: Currently I have this code that shows me the normal data table but if I have millions of records it becomes very slow, I understand that serverside of datatable can be used but I don’t know how I can implement it list.html <table …

Total answers: 2

Dash data table add a column on user input with predefined values

Dash data table add a column on user input with predefined values Question: I have a simple dash app containing a data table.Two user inputs make it possible to add a row or a column. Juste like when I add a row I get default values (here 0 hours) for every column, I would also …

Total answers: 2

Convert parts of .ods table to latex with Pandas/Python

Convert parts of .ods table to latex with Pandas/Python Question: i’m trying to convert a selection of rows and columns from an libreoffice-spreadsheet to Latex-code using Python with Pandas in a Jupyter-Notebook. The goal is to write it in a Python-script, but because, right now, i’m not used to working with Python i chose Jupyter-Notebook …

Total answers: 1

passing variable to a table in flask

passing variable to a table in flask Question: I am following this video and everything is working perfectly. The output of a SQL query is saved within a variable that I can call on in another .html page. so my sql query is: @app.route(‘/all_data’) def all_data(): customers = db.get_customers() for customer in customers: var = …

Total answers: 1

Windows 10, Datatable install issue 'Preparing metadata (pyproject.toml) did not run successfully.'

Windows 10, Datatable install issue 'Preparing metadata (pyproject.toml) did not run successfully.' Question: I have Python 3.10.2, pip 22.0.3, and pyqt5.15.2 . I run into this error when I try to install datatable: pip install datatable Collecting datatable Using cached datatable-1.0.0.tar.gz (1.1 MB) Getting requirements to build wheel … done Preparing metadata (pyproject.toml) … error …

Total answers: 2

How to iterate over rows of a Frame in DataTable

How to iterate over rows of a Frame in DataTable Question: With pandas I usually iterate the rows of a DataFrame with itertuples or iterrows. How can I do this kind of iteration on a Frame from Python DataTable? Exemple of Pandas iteration that I need: for row in df_.itertuples(): print(row) Asked By: Danilo Matrangolo …

Total answers: 2