@@ -153,29 +153,29 @@ def envelope_tables(self):
153
153
if any (regexp .match (row [0 ]) for regexp in self .budget_accounts ):
154
154
if len (row ) > 1 and row [1 ] is not None :
155
155
starting_balance += row [1 ]
156
- self .income_df [ months [ 0 ]][ "Avail Income" ] += starting_balance
156
+ self .income_df . loc [ "Avail Income" , months [ 0 ] ] += starting_balance
157
157
158
158
self .envelope_df .fillna (Decimal (0.00 ), inplace = True )
159
159
160
160
# Set available
161
161
for index , row in self .envelope_df .iterrows ():
162
162
for index2 , month in enumerate (months ):
163
163
if index2 == 0 :
164
- self .envelope_df [ month , "available" ][ index ] = (
164
+ self .envelope_df . loc [ index , ( month , "available" ) ] = (
165
165
row [month , "budgeted" ] + row [month , "activity" ]
166
166
)
167
167
else :
168
168
prev_available = self .envelope_df [
169
169
months [index2 - 1 ], "available"
170
170
][index ]
171
171
if prev_available > 0 or self .negative_rollover :
172
- self .envelope_df [ month , "available" ][ index ] = (
172
+ self .envelope_df . loc [ index , ( month , "available" ) ] = (
173
173
prev_available
174
174
+ row [month , "budgeted" ]
175
175
+ row [month , "activity" ]
176
176
)
177
177
else :
178
- self .envelope_df [ month , "available" ][ index ] = (
178
+ self .envelope_df . loc [ index , ( month , "available" ) ] = (
179
179
row [month , "budgeted" ] + row [month , "activity" ]
180
180
)
181
181
0 commit comments