1

I did an experiment, where I recorded two columns of data (column A and column B). However my experiment needs calculated data. My goal is to create a data frame myself (as you do in excel), but I want to incorporate the formulas I need to get the calculated values for my data.

Note: I'm NOT using an existing data frame. I want to create my own data using arrays. Exactly as you do in excel, you put the values in a table and then plot it.

For example:

Column A      Column B      Column C       
   1              1.1       Column A*constant

Should I create functions for each formula I need? But still I don't know how to incorporate these functions in the arrays.

I'm trying to do literally what you do in excel (create a table with values and incorporate the formula in each cell), but I'm not sure what will be the easiest way to do this for a beginner in Python.

pd im using jupyter notebooks for this with python 3

  • Are you using `pandas`? If so, just use `df['Column C'] = df['Column A'] * constant` – sacuL Oct 29 '18 at 19:10
  • have a look at https://stackoverflow.com/questions/12356501/pandas-create-two-new-columns-in-a-dataframe-with-values-calculated-from-a-pre, https://stackoverflow.com/questions/45393123/adding-calculated-column-in-pandas and https://stackoverflow.com/questions/42796354/how-can-i-add-a-new-computed-column-in-a-dataframe – m0etaz Oct 29 '18 at 19:10
  • Possible duplicate of [Pandas: create two new columns in a dataframe with values calculated from a pre-existing column](https://stackoverflow.com/questions/12356501/pandas-create-two-new-columns-in-a-dataframe-with-values-calculated-from-a-pre) – m0etaz Oct 29 '18 at 19:11
  • what if im not using a data frame in pandas? – Nor Escartin Oct 29 '18 at 19:32

0 Answers0