Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Assigning conditional values in Pandas
Post: RE: Assigning conditional values in Pandas

Hi, here is the complete code in github. It was written by someone years ago and I'm guessing there has been some changes to python since then. https://github.com/minsuk-heo/kaggle-tit...tion.ipynb ...
Scott Data Science 3 819 Dec-18-2023, 07:34 PM
    Thread: Assigning conditional values in Pandas
Post: Assigning conditional values in Pandas

Hi everyone, I am playing around with some old code from online and am getting an error: for dataset in train_test_data: dataset.loc[ dataset['Age'] <= 16, 'Age'] = 0, dataset.loc[(datase...
Scott Data Science 3 819 Dec-14-2023, 09:25 PM
    Thread: Difference one column in a dataframe
Post: Difference one column in a dataframe

Hi everyone, I have a dataframe (df2) with about 5 columns and I want to difference one column and keep the other columns. Do you know how I do that in python code. df_differenced = df2.diff().dropn...
Scott General Coding Help 0 642 Feb-10-2023, 08:41 AM
    Thread: AR roots for VAR coefficients
Post: RE: AR roots for VAR coefficients

(Nov-30-2022, 05:52 AM)Larz60+ Wrote: found this: https://towardsdatascience.com/arima-mod...fc7fb792f9 Don't know if it covers what you want. Unfortunately that does not cover AR roots of the model...
Scott Data Science 2 1,061 Nov-30-2022, 09:23 PM
    Thread: AR roots for VAR coefficients
Post: AR roots for VAR coefficients

Hi everyone, Does anyone know if there is a python equivalent to this r code: https://robjhyndman.com/hyndsight/arma-roots/ Thanks
Scott Data Science 2 1,061 Nov-30-2022, 12:10 AM
    Thread: Graphs from Jupyter notebook to word
Post: Graphs from Jupyter notebook to word

Hi Everyone, Is there an easier way to get graphs from Jupyter notebook to work? I have several graphs to transfer but when I copy paste the size is horrible and the colors are now faded (they weren'...
Scott General Coding Help 0 888 Nov-28-2022, 06:16 AM
    Thread: Loading an array into a matrix
Post: Loading an array into a matrix

Hi everyone, I am trying to load the output of my model into matrix. Below is the model output: [array([[3.3480644, 2.6733143, 2.3946035, 1.651863 , 1.4944869, 1.4064457, 2.0166957, 2.75541...
Scott General Coding Help 1 1,185 May-31-2022, 08:28 AM
    Thread: Loop row and column + 1
Post: RE: Loop row and column + 1

#build a 0 matrix to populate with LSTM output def build_matrix(rows, cols): matrix = [] for r in range(0, rows): matrix.append([0 for c in range(0, cols)]) return matrix LSTM_...
Scott General Coding Help 3 1,386 May-22-2022, 10:48 AM
    Thread: Loop row and column + 1
Post: Loop row and column + 1

Hi everyone, I've made an empty 24,31 (24 columns and 31 rows if I've done the numbers wrong) matrix with all 0. I've also created a loop that a model out puts a 1,8 array. I'd like the model output ...
Scott General Coding Help 3 1,386 May-22-2022, 07:34 AM
    Thread: Forecasting with ARIMAX
Post: Forecasting with ARIMAX

Hi everyone, I am trying to forecast GDP with an ARIMAX model but because it uses exogenous variables I cannot use the model to make forecasts because I don't have exogenous variables for future date...
Scott Data Science 0 1,961 Jan-14-2022, 08:41 PM
    Thread: Slicing a 2 dimensional array
Post: RE: Slicing a 2 dimensional array

y_pred2 = y_pred[0:,8:16]
Scott General Coding Help 2 1,663 Jan-12-2022, 06:33 AM
    Thread: Slicing a 2 dimensional array
Post: Slicing a 2 dimensional array

Hi guys, I have the array below: [[1.6727031 1.5464988 1.6836944 1.8492563 1.968533 2.2368639 2.6653275 2.7314425 2.8197284 2.969603 2.8251243 2.086564 2.274447 2.2914152 2.2962196 2.381342 ...
Scott General Coding Help 2 1,663 Jan-12-2022, 06:16 AM
    Thread: DSGE Models
Post: DSGE Models

Hi guys, I am wanting to test some modelling approaches for forecasting some timeseries data. I have an LSTM and would like to compare it to a DSGE model. Does anyone know of an econometrics library ...
Scott Data Science 1 2,041 Aug-31-2021, 06:56 PM
    Thread: Sum based on conditions
Post: RE: Sum based on conditions

Thanks, I changed my code to the below and think I am closer: sums['Meat'] = data([data['Harmonised System Code'].str.slice(0,3) == '2013'])[['Imports ($NZD cif)']].sum() sums.head()I know get error:...
Scott General Coding Help 3 2,077 Jan-12-2021, 04:38 AM
    Thread: Sum based on conditions
Post: Sum based on conditions

Hi Everyone, I am trying to sum a column in a dataframe where the substring of another column is equal to a certain value. My code is: sums['Meat'] = data['Imports ($NZD cif)'].sum(axis=1).where(d...
Scott General Coding Help 3 2,077 Jan-11-2021, 06:23 AM
    Thread: Currency converter
Post: RE: Currency converter

Thanks Paul, I was able to solve the issue with this simple code: exchange_rate = df[from_currency][to_currency]Regards
Scott General Coding Help 5 2,997 Jun-14-2020, 11:59 PM
    Thread: Currency converter
Post: RE: Currency converter

Hi Paul, I want this part: FromCurrency_option = OptionMenu(root, variable1, *CurrencyCode_list) ToCurrency_option = OptionMenu(root, variable2, *CurrencyCode_list)to reference the dataframe...
Scott General Coding Help 5 2,997 Jun-14-2020, 08:07 AM
    Thread: Currency converter
Post: Currency converter

Hi everyone, I found a exchange rate calculator online built in tkinter and am trying to update it to reference my dataframe exchange rate variables. Does anyone know how I can do that? #Building a ...
Scott General Coding Help 5 2,997 Jun-14-2020, 01:04 AM
    Thread: XGboost Regressor output
Post: XGboost Regressor output

Hi everyone, I am running an XGBoost regressor model with a lot of independent variables. I want to get the model out put for each of the independent variables and the intercept. Does anyone know how...
Scott Data Science 0 1,275 Mar-09-2020, 01:43 AM
    Thread: Lime for regression interpretability
Post: RE: Lime for regression interpretability

I cannot find anything in Scikit-learn that shows variables predicative power. Anyone else know? On another note I can install lime on my personal computer. I think my work python has been compromise...
Scott Data Science 5 2,925 Feb-14-2020, 06:59 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020