IconResources
Conduct analysis

Add data

Insert new columns, rows, or values into your dataset.

Example Data

Follow along with right out of the box example data. Copy following data in the information request of the agent you are working in.



Sometimes we don’t just analyze data — we expand it. You might want to add a new column for calculations, add rows for updated transactions, or correct a few specific cells.

In this section, we’ll learn how to insert new information into your table by column, row, or individual cell.

Add a new column

Excel

In Excel, you add a column by typing in a new header and filling values manually or using a formula.

t0 Prompt

Add a new column called "Secondary Currency"

Create a column called "Flag" and fill it with "Yes"

Insert column X into the table

Code

The python code looks as follows:

transactions["Flag"] = "Yes"
transactions

Add a calculated column

Excel

In Excel, you might create a formula like =Amount*0.05 to calculate VAT or similar metrics.

t0 Prompt

Add a column with 10% of the value in column X

Create a new column that is Amount divided by 1 million

Make a column and calculate 1.2 times column Amount

Code

The python code looks as follows:

transactions["Amount"] = pd.to_numeric(transactions["Amount"])
transactions["Amount (in millions)"] = transactions["Amount"] / 1_000_000
transactions

Add a single row

Excel

In Excel, you insert a new row and manually type in values for each cell.

t0 Prompt

Add a new row for a transaction from Italy to Brazil

Insert a new row with today's date and 5 million in Amount column

Code

The python code looks as follows:

new_row = {
    "Date": "2025.4.15",
    "Seller": "Solara Dynamics AB",
    "Seller Country": "Sweden",
    "Buyer": "Solara Dynamics Inc.",
    "Buyer Country": "United States",
    "Transaction": "Services",
    "Currency": "USD",
    "Amount": 5000000
}
transactions = pd.concat([transactions, pd.DataFrame([new_row])], ignore_index=True)
transactions

Update a single cell

Excel

In Excel, you double-click a cell and type in a new value.

t0 Prompt

Change the amount in row 2 to 8 million

Edit the date in the first row to 4.5.2025

Update a value in the table from X to Y

Code

The python code looks as follows:

transactions.at[1, "Amount"] = 8000000
transactions
FunctionDescription
df["New Column"] = valueAdds a new column
df["Column"] = expressionCreates a calculated column
pd.concat([df, new_row])Adds a row to the bottom
df.at[row_index, "Column"] = xUpdates a single cell by row and column

On this page