Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: HELP! i need the solution to show for original indexing
Post: HELP! i need the solution to show for original ind...

import pandas as pd df = pd.read_csv('Instances.csv', header = 1) def Knapsack(K,s,v,n): # 3 & 4 x = [0] * n z = 0 # 5 R = [] for i in range(n): R.append((...
bntayfur General Coding Help 1 1,523 Oct-02-2020, 05:27 PM
    Thread: Please Help!
Post: something wrong with code

1: Input: n items with size si,value vi 2: Input: Knapsack capacity K 3: Set solution vector x equal to 0 for all xi 4: Set current objective function value z = 0 5: Calculate ri =vi/si for all items ...
bntayfur Homework 4 26,185 Oct-01-2020, 04:14 PM
    Thread: Please Help!
Post: RE: Please Help!

def knapSack(K,s,v,n): z=0 u=0 listx=[] R=[] for k in s: m=v[k] r= m/k R.append(r) R.sort() if s.index(k)== len(s)-1: R.reverse(...
bntayfur Homework 4 26,185 Oct-01-2020, 04:10 PM
    Thread: Please Help!
Post: Please Help!

I tried so many times but i couldn't do it :( The steps are all below, someone please help me! Algorithm 1 Greedy Algorithm for the Continuous Knapsack Problem 1: Input: n items with size si, value...
bntayfur Homework 4 26,185 Oct-01-2020, 08:00 AM
    Thread: how to install pyramid.arima in jupyter notebook
Post: how to install pyramid.arima in jupyter notebook

!pip install pyramid.arima from pyramid.arima import auto_arimaError:.... error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft....
bntayfur General Coding Help 1 4,178 Aug-06-2020, 04:29 AM
    Thread: RuntimeError: Optimal parameters not found: Number of calls to function has reached m
Post: RuntimeError: Optimal parameters not found: Number...

population = float(46750238) country_df = pd.DataFrame() country_df['ConfirmedCases'] = train.loc[train['Country_Region']=='Spain'].ConfirmedCases.diff().fillna(0) country_df = country_df[10:] country...
bntayfur General Coding Help 0 6,150 Aug-05-2020, 04:41 PM
    Thread: HELP- DATA FRAME INTO TIME SERIES- BASIC
Post: HELP- DATA FRAME INTO TIME SERIES- BASIC

Ok, so i have a data frame and i want to change it to time series. Output: Month Sales Inflation 0 1-Jan 266.0 1 1 2-Jan 145.9 3 2 3-Jan 183.1 5 3 4-Jan 119.3 ...
bntayfur Data Science 0 1,766 Jul-11-2020, 09:04 PM
    Thread: Check all input, easy way! Help pls!
Post: RE: Check all input, easy way! Help pls!

Thank you!
bntayfur General Coding Help 2 1,803 Jul-05-2020, 10:58 PM
    Thread: Check all input, easy way! Help pls!
Post: Check all input, easy way! Help pls!

while True: try: midterm_1= float(input('Please enter your first midterm: ')) midterm_2= float(input('Please enter your second midterm: ')) midterm_total= midterm_...
bntayfur General Coding Help 2 1,803 Jul-05-2020, 09:00 PM
    Thread: outcome 0 but impossiblenumbers change
Post: outcome 0 but impossiblenumbers change

i= 1 top_hat= [] while i<=5: try: top_hat.append(int(input('Please enter your top hat score: '))) i+=1 except: print('Please enter valid number: ') print(top_h...
bntayfur General Coding Help 1 1,487 Jul-05-2020, 08:52 PM
    Thread: Simple code help
Post: Simple code help

def is_integer_num(n): if isinstance(n,float): print(input(n)) else: print("not a number") n=input('Please enter number: ') is_integer_num(n)It says not a number to ...
bntayfur General Coding Help 2 1,788 Jul-05-2020, 07:22 PM
    Thread: Simple code error please help
Post: RE: Simple code error please help

Thank you so much!
bntayfur General Coding Help 7 3,482 Jun-07-2020, 11:10 PM
    Thread: how to break the loop?
Post: RE: how to break the loop?

Thank you so so much!
bntayfur General Coding Help 8 3,070 Jun-07-2020, 11:07 PM
    Thread: pandas index not updating please help
Post: pandas index not updating please help

I can't get rid of the old index, still shows the old index and the index title is on top of the old one. what might be the reason for it? Thanks :) the data source is: https://github.com/KeithGalli/P...
bntayfur General Coding Help 0 1,452 Jun-07-2020, 10:57 PM
    Thread: how to break the loop?
Post: RE: how to break the loop?

The only problem i realized is that whenever the user makes a mistake, it starts from the beginning. i just want it to ask the last question again, but putting try and except for each input is hard, t...
bntayfur General Coding Help 8 3,070 Jun-04-2020, 01:40 PM
    Thread: how to break the loop?
Post: how to break the loop?

This runs forever even though i used break :( while True: try: midterm_1=float(input('Please enter your first midterm score: ')) midterm_2=float(input('Please enter your secon...
bntayfur General Coding Help 8 3,070 Jun-04-2020, 01:17 PM
    Thread: how to break the loop?
Post: how to check input once for all

I want to check all the input i receive, i know i can put float or int at the beginning of the input but i want it to print an error message when error occurs.(a way to do this?) I used try and exce...
bntayfur General Coding Help 8 3,070 Jun-04-2020, 01:02 PM
    Thread: help me make this code better please (basic)
Post: RE: help me make this code better please (basic)

Oh yes this is way better thanks! How about checking all the inputs is between 0 and 100 (also i have to make sure it must be only digits)It should be in a loop so if the user writes wrong it will pri...
bntayfur Code Review 4 2,695 Jun-04-2020, 03:13 AM
    Thread: help me make this code better please (basic)
Post: help me make this code better please (basic)

It works fine if i give the right numbers **lol** All the input must be between 0 and 100, it doesn't check that. How do i make the code simpler? For example, in if elif else part is there a way to...
bntayfur Code Review 4 2,695 Jun-04-2020, 02:55 AM
    Thread: taking input doesnt print as list
Post: RE: taking input doesnt print as list

Thank you!
bntayfur General Coding Help 2 2,120 Jun-04-2020, 02:48 AM

User Panel Messages

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