[Solved] How to remove duplicate from string/mixed list

I think this is what you are trying to achieve: x = [] while True: data = input() if data.lower() == “done”: break if data not in x: x.append(data) Note the use of while True and break to avoid having two input calls. Alternatively, use a set: x = set() while True: data = input() … Read more

[Solved] Need Help converting to python 2.7

You might want to try future statements. Basically, keep the code the way it is, and backport features to 2.7. I already see the print statements causing problems, so at the top just add from __future__ import print_statement. This will cause Python 2.7 to read print as if it were running in 3.x. Running the … Read more

[Solved] python,typeerror:cannot concatenate ‘str ‘and ‘float’ objects

You need to convert the calculated number into a string before performing string methods on it. This might help: (“Celcius is:” + str(celcius)) You could also use the following method if you do not want to convert float to string: (“Celcius is: {}”.format(celcius)) 0 solved python,typeerror:cannot concatenate ‘str ‘and ‘float’ objects

[Solved] how to calculation cost time [closed]

I think I understand what you’re asking. You just want to have a new dataframe that calculates the time difference between the three different entries for each unique order id? So, I start by creating the dataframe: data = [ [11238,3943,201805030759165986,’新建订单’,20180503075916,’2018/5/3 07:59:16′,’2018/5/3 07:59:16′], [11239,3943,201805030759165986,’新建订单’,20180503082115,’2018/5/3 08:21:15′,’2018/5/3 08:21:15′], [11240,3943,201805030759165986,’新建订单’,20180503083204,’2018/5/3 08:32:04′,’2018/5/3 08:32:04′], [11241,3941,201805030856445991,’新建订单’,20180503085644,’2018/5/3 08:56:02′,’2018/5/3 08:56:44′], [11242,3941,201805022232081084,’初审成功’,20180503085802,’2018/5/3 08:58:02′,’2018/5/3 08:58:02′], … Read more

[Solved] Pyconfigini: ImportError: No module named lib.pyconfigini

The problem is that you’re running python setting.py from app/ directory (which at the moment of script start becomes current working directory) . Python looks for modules in directories that are listed in PYTHONPATH environment variable (you can get access to it from Python code via sys.path variable). This list of directories contains standard site-packages, … Read more

[Solved] Scraped CSV pandas dataframe I get: ValueError(‘Length of values does not match length of ‘ ‘index’)

You need merge with inner join: print(‘####CURRIES###’) df1 = pd.read_csv(‘C:\\O\\df1.csv’, index_col=False, usecols=[0,1,2], names=[“EW”, “WE”, “DA”], header=None) print(df1.head()) ####CURRIES### EW WE \ 0 can v can 1.90 1 Lanus U20 v Argentinos Jrs U20 2.10 2 Botafogo RJ U20 v Toluca U20 1.83 3 Atletico Mineiro U20 v Bahia U20 2.10 4 FC Porto v Monaco … Read more

[Solved] Project Euler #3 Python

I’m assuming you meant set n = 49. Your outer while loop checks the condition i * i < n, which is not true for i == 7, so the outer loop breaks as soon as it hits 7. Change the < to <=. However, your code isn’t correct in the first place– perhaps something … Read more

[Solved] Can I design a button like the one given in pic using Kivy? [closed]

Are the above things possible with Kivy? The answer is simply ‘yes’. Do you have a specific context that you’re having trouble with? You simply need to create your own widget rule that displays things the way you want. It might start as something like <YourRule@BoxLayout>: text: ‘something’ # define a property to hold the … Read more

[Solved] How to use Python to login and detect error if the combination is wrong

Please note that when working with Python for web dev, it’s most convenient to use an already established framework, such as Flask which uses Werkzeug (simple and efficient). I suggest you read up on Python web development here https://docs.python.org/2/howto/webservers.html and head to http://www.codecademy.com and finish the Python course first if you are unfamiliar with how … Read more