Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Web Crawler help
Post: RE: Web Crawler help
(Jan-28-2019, 12:39 PM)Stoss Wrote: Do you have a final version of the code you can share with me?
Thanks!
Sure, but it is not working anymore after I used it for about 2 weeks. I only needed it tem... |
|
takaa |
Web Scraping & Web Development |
39 |
27,410 |
Jan-30-2019, 08:35 AM |
|
|
Thread: Pandas question
Post: RE: Pandas question
(Dec-04-2017, 04:04 PM)snippsat Wrote: it's much better if you could post code that could be run,
especially when it comes to pandas and alike than many of use sporadically.
Here how it could be do... |
|
takaa |
Data Science |
3 |
3,837 |
Dec-05-2017, 01:03 PM |
|
|
Thread: Pandas question
Post: RE: Pandas question
in case somebody is interested, the following is the answer to my question above.
match = df.max(axis=1).to_frame() # shows the highest score
match1 = df.idxmax(axis=1).to_frame() # s... |
|
takaa |
Data Science |
3 |
3,837 |
Dec-04-2017, 02:15 PM |
|
|
Thread: Pandas question
Post: Pandas question
Hi
I have a dataframe that looks like this:
Output: 1 2 4 5 3
1 0.25 0 0.75 0 0
2 0 0.75 0 0 0
4 0.75 0 0.25 0 0
5 0 0 0 1 0
3 0 0 ... |
|
takaa |
Data Science |
3 |
3,837 |
Dec-02-2017, 12:26 PM |
|
|
Thread: transform list to tuple with
Post: RE: transform list to tuple with
(Nov-28-2017, 10:38 PM)snippsat Wrote: >>> lst = [(1,), (2,), (3,), (4,), (5,)]
>>> [str(x[0]) for x in lst]
['1', '2', '3', '4', '5']
>>> # If need tuple
>>> tup... |
|
takaa |
General Coding Help |
2 |
2,863 |
Nov-28-2017, 10:44 PM |
|
|
Thread: transform list to tuple with
Post: transform list to tuple with
Hi,
summary:
I have this output: [(1,), (2,), (3,), (4,), (5,)]
Question, how can I transform this to: ('1', '2','3','4',5')
Below is my trial
sId = cur1.fetchall()
print(sId)Output:[(1,), (2,), (3... |
|
takaa |
General Coding Help |
2 |
2,863 |
Nov-28-2017, 10:30 PM |
|
|
Thread: pandas Dataframe as "confidence table" for matchmaking?
Post: RE: pandas Dataframe as "confidence table" for mat...
I did find an answer to the question posted.
for s in table_1:
df1= df.loc['s3','i4']
df2 = df.set_value('s3', 'i4', df1 +10, takeable=False)If somebody has any suggestion regarding the ap... |
|
takaa |
Data Science |
1 |
3,446 |
Nov-28-2017, 07:48 PM |
|
|
Thread: pandas Dataframe as "confidence table" for matchmaking?
Post: pandas Dataframe as "confidence table" for matchma...
Hi,
I wonder if I am on the right track and would like to get your input on my problem:
Goal:
Find a link between two rows in two tables based on a number of criteria.
Approach:
I want to work wit... |
|
takaa |
Data Science |
1 |
3,446 |
Nov-28-2017, 04:36 PM |
|
|
Thread: Return Row ID postgresql
Post: Return Row ID postgresql
Hi,
I make a match between 2 tables in a database and I want to use the ID's of the rows where the matches are made.
Sometimes this works correct and i get the different row numbers returned, but no... |
|
takaa |
General Coding Help |
1 |
3,681 |
Nov-24-2017, 12:03 AM |
|
|
Thread: matching question
Post: RE: matching question
(Nov-21-2017, 07:01 PM)iFunKtion Wrote: A slightly simpler way would be to just use the one for loop, as you only need to iterate through one list and check if each iteration is in the other list:
p... |
|
takaa |
General Coding Help |
11 |
6,954 |
Nov-23-2017, 10:14 AM |
|
|
Thread: python variable in SQL query
Post: RE: python variable in SQL query
(Nov-23-2017, 10:01 AM)buran Wrote: from the docs
Quote: The placeholder must not be quoted. Psycopg will add quotes where needed:
>>> cur.execute("INSERT INTO numbers VALUES ('%s')", (10,)... |
|
takaa |
General Coding Help |
5 |
31,463 |
Nov-23-2017, 10:12 AM |
|
|
Thread: python variable in SQL query
Post: RE: python variable in SQL query
(Nov-22-2017, 10:12 PM)micseydel Wrote: Actually - it's possible they're being escaped. So you can try removing the quotes, or creating a participant named 'Cleavon' or "Cleavon".
I have tried remov... |
|
takaa |
General Coding Help |
5 |
31,463 |
Nov-23-2017, 09:52 AM |
|
|
Thread: python variable in SQL query
Post: python variable in SQL query
Hi,
When I use an integer as variable in my SQL query it works as it should. However if work with a string It does not work, I don't get an error message but also not results.
THis is the code that ... |
|
takaa |
General Coding Help |
5 |
31,463 |
Nov-22-2017, 09:30 PM |
|
|
Thread: matching question
Post: RE: matching question
Great, now the number of matches is correctly stated by matches two database tables. The next step is included "yes" in the column "participants_paid" of the participants table for all the participant... |
|
takaa |
General Coding Help |
11 |
6,954 |
Nov-21-2017, 04:11 PM |
|
|
Thread: matching question
Post: RE: matching question
thanks guys for the quick help, much appreciated!
I have now replaced "participants" with the participant names from a database table:
import psycopg2 as p
import re
conn = p.connect ("dbname='part... |
|
takaa |
General Coding Help |
11 |
6,954 |
Nov-21-2017, 03:10 PM |
|
|
Thread: matching question
Post: RE: matching question
(Nov-21-2017, 11:11 AM)heiner55 Wrote: You could use index():
https://www.tutorialspoint.com/python/list_index.htm
If not, you need two for-loops.
Why do I need two for loops?
If I look at the cod... |
|
takaa |
General Coding Help |
11 |
6,954 |
Nov-21-2017, 11:35 AM |
|
|
Thread: matching question
Post: matching question
Hi all,
I am building a personal project to match items from two different db tables. I got stuck so I started to break down my problems in little pieces. Here is one little piece regarding the matc... |
|
takaa |
General Coding Help |
11 |
6,954 |
Nov-21-2017, 10:14 AM |
|
|
Thread: Output on same line
Post: RE: Output on same line
(May-03-2017, 11:48 AM)buran Wrote: Several other issues with your code:
Tnx for pointing out. Makes the learning curve keep going up and to the right |
|
takaa |
General Coding Help |
4 |
5,214 |
May-03-2017, 03:28 PM |
|
|
Thread: Output on same line
Post: RE: Output on same line
Tnx
I solved it with this line
symbolslist = symbolfile.read()
symbolslist = symbolslist.split('\n') |
|
takaa |
General Coding Help |
4 |
5,214 |
May-03-2017, 11:24 AM |
|
|
Thread: Output on same line
Post: Output on same line
Hi,
I made a little code to extract some stock quotes.
open('outputyahoo.txt', 'w').close()
from yahoo_finance import Share
symbolfile = open('symbols.txt')
symbolslist = symbolfile.readlines()
... |
|
takaa |
General Coding Help |
4 |
5,214 |
May-03-2017, 10:02 AM |