Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Check common element in tuples
Post: RE: Check common element in tuples
The best way to check for common elements is to use sets.
A proper solution would be a list of 3 values - since you compare 4 neighbours, but - taking your restraints into account.
from functools im... |
|
volcano63 |
General Coding Help |
10 |
5,841 |
Nov-02-2020, 07:25 PM |
|
|
Thread: maximum recursion depth exceeded while calling a Python object error in python3
Post: RE: maximum recursion depth exceeded while calling...
Never use if var == True: - use if var:
Likewise, use if var == False: - use if not var:
Booleans can have only 2 values - True and False. var == True creates .... another boolean - which will be Tr... |
|
volcano63 |
General Coding Help |
4 |
3,741 |
Aug-02-2020, 11:43 AM |
|
|
Thread: Invoking function in if else statement, not working!
Post: RE: Invoking function in if else statement, not wo...
This piece of code makes no sense
while i>=0:
if data[i]==' ':
i=i+1
continue
else:
break
You are incrementing i- it ... |
|
volcano63 |
General Coding Help |
13 |
5,596 |
May-30-2019, 07:43 PM |
|
|
Thread: Invoking function in if else statement, not working!
Post: RE: Invoking function in if else statement, not wo...
(May-30-2019, 06:54 PM)SheeppOSU Wrote: You may have to close the file at the end
filename.close()No, he does not - with operator guarantees closing of the file |
|
volcano63 |
General Coding Help |
13 |
5,596 |
May-30-2019, 06:56 PM |
|
|
Thread: How to define a function that calculates the BMI from dataframe
Post: RE: How to define a function that calculates the B...
(May-30-2019, 02:34 PM)heiner55 Wrote: #!/usr/bin/python3
import pandas as pd
data = [
{ 'h': 1.80, 'w': 80 },
{ 'h': 1.70, 'w': 90 },
{ 'h': 1.60, 'w': 60 },
]
df = pd.DataFrame(data)
print... |
|
volcano63 |
General Coding Help |
2 |
5,850 |
May-30-2019, 03:35 PM |
|
|
Thread: Is PEP-8 dead?
Post: RE: Is PEP-8 dead?
(Oct-20-2018, 02:06 PM)ichabod801 Wrote: And as PEP-8 says, "Consistency within a project is more important" than consistency with PEP-8. Among other things, I think that means that if their teacher... |
|
volcano63 |
Board |
9 |
6,355 |
Oct-20-2018, 02:52 PM |
|
|
Thread: Is PEP-8 dead?
Post: RE: Is PEP-8 dead?
(Oct-20-2018, 11:07 AM)snippsat Wrote: (Oct-20-2018, 09:39 AM)volcano63 Wrote: Aren't you tired of the herds of camelCase in the demonstrated code?Sure,but can not do anything else than mention th... |
|
volcano63 |
Board |
9 |
6,355 |
Oct-20-2018, 11:26 AM |
|
|
Thread: OS command via python subprocess module
Post: RE: OS command via python subprocess module
(Oct-20-2018, 10:22 AM)alinaveed786 Wrote: thanks, it worked. Moreover, I installed the plumbum module and executed the code but got below error
Traceback (most recent call last):
File "/u02/scrip... |
|
volcano63 |
General Coding Help |
21 |
10,809 |
Oct-20-2018, 11:11 AM |
|
|
Thread: Copy raw data in excel to another new excel file
Post: RE: Copy raw data in excel to another new excel fi...
(Oct-20-2018, 02:20 AM)keerthiprashanth Wrote: As i am new user i am not sure about the script.
Can you please provide me a sample script.
It is a 5-6 line task. No complex algorithm. RT(F)M and do... |
|
volcano63 |
Data Science |
5 |
3,888 |
Oct-20-2018, 10:13 AM |
|
|
Thread: Is PEP-8 dead?
Post: Is PEP-8 dead?
(in this forum?!)
Dear moderation team,
Aren't you tired of the herds of camelCase in the demonstrated code?
Though I understand that many of member come to the forum - quoting an admin of some Pyt... |
|
volcano63 |
Board |
9 |
6,355 |
Oct-20-2018, 09:39 AM |
|
|
Thread: Issue with re.findall
Post: RE: Issue with re.findall
(Oct-20-2018, 05:57 AM)alinaveed786 Wrote: I was able to achieve via below modifications. Thanks everyone for all the help and support
#!/usr/bin/python
import re
import subprocess
s = subproces... |
|
volcano63 |
General Coding Help |
8 |
4,827 |
Oct-20-2018, 09:28 AM |
|
|
Thread: AttributeError: '' object has no attribute ''
Post: RE: AttributeError: '' object has no attribute ''
(Oct-19-2018, 10:12 AM)Santhosh198915 Wrote: Built this using this soruce https://towardsdatascience.com/pytorch-h...54597b5f17
Python-wise - not a very good coding style, and you copy-pasted the bu... |
|
volcano63 |
General Coding Help |
6 |
7,362 |
Oct-19-2018, 10:25 AM |
|
|
Thread: AttributeError: '' object has no attribute ''
Post: RE: AttributeError: '' object has no attribute ''
(Oct-19-2018, 08:59 AM)Santhosh198915 Wrote: (Oct-19-2018, 08:44 AM)volcano63 Wrote: Indentation of lines 26 and 30 are wrong.
Even with proper Indentation i am getting the same error
Line 23 - co... |
|
volcano63 |
General Coding Help |
6 |
7,362 |
Oct-19-2018, 09:11 AM |
|
|
Thread: AttributeError: '' object has no attribute ''
Post: RE: AttributeError: '' object has no attribute ''
Indentation of lines 26 and 30 are wrong. |
|
volcano63 |
General Coding Help |
6 |
7,362 |
Oct-19-2018, 08:44 AM |
|
|
Thread: Python Program to Make a Simple Calculator
Post: RE: Python Program to Make a Simple Calculator
(Oct-19-2018, 08:30 AM)buran Wrote: Welcome to the forum. What exactly is your question?
May guess would be
Quote:How to write ineffectife Python code
|
|
volcano63 |
General Coding Help |
2 |
10,158 |
Oct-19-2018, 08:32 AM |
|
|
Thread: Why interpreter accepts indentation made with spaces and not those by tabs
Post: RE: Why interpreter accepts indentation made with ...
(Oct-18-2018, 06:12 PM)sylas Wrote: IMy way works very well.Two threads on this non-issue are an ample proof **snooty** |
|
volcano63 |
General Coding Help |
13 |
5,537 |
Oct-19-2018, 08:29 AM |
|
|
Thread: Write specific rows from pandas dataframe to csv file
Post: RE: Write specific rows from pandas dataframe to c...
(Oct-18-2018, 08:25 PM)pradeepkumarbe Wrote: Yes I agree UUID will solve my problem, but my output should be like below here how can we avoid Iteration?
Territory NoOfCustomers UniqueId
D0006... |
|
volcano63 |
Data Science |
3 |
5,499 |
Oct-18-2018, 09:33 PM |
|
|
Thread: An Extra 'None'
Post: RE: An Extra 'None'
(Oct-18-2018, 08:14 PM)buran Wrote: (Oct-18-2018, 08:05 PM)volcano63 Wrote: I would suggest for ind a book/learning resource by a legitimate Python specialist
@volcano: Sometimes it's good to do s... |
|
volcano63 |
General Coding Help |
5 |
3,882 |
Oct-18-2018, 08:20 PM |
|
|
Thread: Write specific rows from pandas dataframe to csv file
Post: RE: Write specific rows from pandas dataframe to c...
(Oct-18-2018, 07:48 PM)pradeepkumarbe Wrote: for idx, item in df[low_dense].iterrows(): ???
Now I will have to create 10 records means 10 unique ID using UUID for each territory having customer... |
|
volcano63 |
Data Science |
3 |
5,499 |
Oct-18-2018, 08:14 PM |
|
|
Thread: An Extra 'None'
Post: RE: An Extra 'None'
(Oct-18-2018, 06:20 PM)leoahum Wrote: (Oct-18-2018, 03:07 PM)leoahum Wrote: I'm trying a piece of script from Magnus Lie Hetland's book. It goes as below.
class Person:
def setName(self, nam... |
|
volcano63 |
General Coding Help |
5 |
3,882 |
Oct-18-2018, 08:05 PM |