Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Array manipulation
Post: RE: Array manipulation

You could create a set extracting all the unique IDs. Then create a new dataframe and in a loop add every new column quering the old dataframe for every element in the set.
baquerik General Coding Help 7 2,788 Feb-09-2020, 08:57 PM
    Thread: AttributeError
Post: RE: AttributeError

Maybe you can use the Windows Linux subsystem and run it in it.
baquerik General Coding Help 35 13,826 Nov-19-2019, 06:27 PM
    Thread: Classification of Request
Post: RE: Classification of Request

I do not understand what you are trying to achieve or what error you are facing. But the sr variable (bad name by the way) it is defined within the function createSetOfRequest so it will not be reach...
baquerik Data Science 8 3,968 Nov-19-2019, 11:27 AM
    Thread: Parquet format conversion problem
Post: RE: Parquet format conversion problem

1.- There is no attached CSV file. 2.- Please, provide your code. What have you tried? Where did it go wrong?
baquerik General Coding Help 1 1,645 Nov-19-2019, 11:06 AM
    Thread: Writting to file from if/else statement
Post: RE: Writting to file from if/else statement

If you run your code today it basically does: "Is 19 in 20/11/2019?" --> True --> Write the file. "Is not 19 in 20/11/2019?" --> False --> Does not write the file. So it makes sense tha...
baquerik General Coding Help 2 1,867 Nov-19-2019, 10:40 AM
    Thread: Reading blob data from database by python and store it in .zip format
Post: RE: Reading blob data from database by python and ...

It seems like you are not getting the same type of object during both procedures. In your code 1 try:row = cursor.fetchone() print(type(row)) blobdata = np.array(row[1].read()) cursor.close()And in y...
baquerik General Coding Help 2 6,593 Nov-18-2019, 03:59 PM
    Thread: AttributeError
Post: RE: AttributeError

Strangely enough, that part of the code works good for me in Python 3.7.3 (Linux): Python 3.7.3 (default, May 11 2019, 00:38:04) [GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux Type "help", "copyrig...
baquerik General Coding Help 35 13,826 Nov-18-2019, 03:12 PM
    Thread: Error in code
Post: RE: Error in code

Well, you catch the error with Try, it goes back to the beginning of the while and then when it reaches the for loop it starts from 0 again. So it will always look for 4 new records after every error....
baquerik General Coding Help 5 2,439 Nov-15-2019, 02:45 PM
    Thread: Error in code
Post: RE: Error in code

I put wrong info in ("A") and it only asks for 4 lanes: Output:Please enter whether it is a male or female race. M/F M Please input how many racers will be participating? There's a limit from 4-8 rac...
baquerik General Coding Help 5 2,439 Nov-15-2019, 02:35 PM
    Thread: Split a long string into other strings with no delimiters/characters
Post: RE: Split a long string into other strings with no...

Was that whole string between the same tags in the original web?
baquerik General Coding Help 4 2,769 Nov-15-2019, 02:17 PM
    Thread: Need help XE1 SyntaxError
Post: RE: Need help XE1 SyntaxError

I am unable to replicate your error in Python 3.7.3. The code works. Try adding at the top: #!/usr/bin/python # -*- coding: utf-8 -*-More info in this PEP: https://www.python.org/dev/peps/pep-0263/
baquerik General Coding Help 1 1,842 Nov-15-2019, 01:21 PM
    Thread: splitting a random song
Post: RE: splitting a random song

When you call... while True: random_song, random_artist = song_selection(songnames, songartists) split_song(songnames) breakYou are passing songnames (a list) to s...
baquerik General Coding Help 3 2,332 Nov-15-2019, 01:04 PM
    Thread: Print string in a single line
Post: RE: Print string in a single line

print( "".join(word_break),end="")
baquerik General Coding Help 8 4,163 Nov-07-2019, 03:05 PM
    Thread: Problem installing instaloader
Post: RE: Problem installing instaloader

Well, there are many ways of doing it. You could simply update a variable in every iteration and show the number catching the error when it occurs: counter = 0 try: for post in takewhile(lambda...
baquerik General Coding Help 21 19,495 Nov-05-2019, 11:03 AM
    Thread: Problem installing instaloader
Post: RE: Problem installing instaloader

Have no clue about instaloader or how it works, but here a couple of ideas: · In order to see their limit, you could put a counter and see after how many iterations you get this error message. · If t...
baquerik General Coding Help 21 19,495 Nov-05-2019, 10:35 AM
    Thread: cv2 show image
Post: RE: cv2 show image

I do not see how. csv2.imshow requires a path to an image, not a folder. Try changing the path to: path=r'C:\\Users\\PycharmProjects\\client-server\\name_of_the_picture.png'
baquerik General Coding Help 4 10,084 Nov-04-2019, 08:51 PM
    Thread: Delete specific lines contain specific words
Post: RE: Delete specific lines contain specific words

The f.write must be inside the loop, otherwise you only handle the last line for line in lines: if name in line.strip("\n"): continue f.write(line)
baquerik General Coding Help 2 4,122 Nov-04-2019, 04:01 PM
    Thread: Matrix Calculation Problem
Post: RE: Matrix Calculation Problem

(Nov-04-2019, 02:55 PM)arshad Wrote: Why j in range(0) is not excuted because it value present in array A. i.e A[1][0]. why the code doesnot pick this value? range(0) returns a 0. That means that it...
baquerik General Coding Help 4 2,633 Nov-04-2019, 03:48 PM
    Thread: cv2 show image
Post: RE: cv2 show image

Hallo Mcgrim, When you run this code path=r'C:\\Users\\PycharmProjects\\client-server' image = cv2.imread(path, 0)You are not specifying what image it should show, you only gave the path to the fold...
baquerik General Coding Help 4 10,084 Nov-04-2019, 03:15 PM
    Thread: Object and lane line detection
Post: RE: Object and lane line detection

I have no idea about cv2.imshow, but probably having some code would help others to assist you.
baquerik General Coding Help 2 1,915 Nov-04-2019, 10:15 AM

User Panel Messages

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