I am new to python and coding in general. So what I am trying to achieve is to flip each bit in a binary string (for eg. if I input ‘110’ the output should be ‘001’). I specifically need to use the while loop and I need to define it as a function. Here is what I’ve tried so far:
“Maximum number of parameters” error with filter .in_(list) using pyodbc
One of our queries that was working in Python 2 + mxODBC is not working in Python 3 + pyodbc; it raises an error like this: Maximum number of parameters in the sql query is 2100. while connecting to SQL Server. Since both the printed queries have 3000 params, I thought it should fail in both environments, but clearly that
Pandas – iloc – comparing value to the cell below
For the following table: Using Pandas – I would like achieve the desired_output column, that is TRUE when the value below the current cell i different – otherwise FALSE. I have tried the following code – but error occurs. Answer
Why time zone conversation doesn’t affect the figure in plotting datetime objects in matplotlib?
I’m trying to plot a figure in which dates, without times, are in x-axis and times, without dates, are in y-axis: The above code works well. However when I convert time zones from UTC to US/Eastern I get the same result, as if I did nothing. The result of both before and after time zone conversation: When I print, for
Create Dataframe by calling indices of df1 that are listed in df2
I’m new to Python Pandas and struggling with the following problem for a while now. The following dataframe df1 values show the indices that are coupled to the values of df2 that should be called df2 contains the values that belong to the indices that have to be called. For example, df1 shows the value ‘0’ in column ‘Name161’. Then
Pivot table unable to get same output as excel
I have a dataframe below: I’m trying to find the customer that keeps coming back I did this but it returned me this Edit: I am trying to get the sum of the total amount and the count of the customer code. Any help is appreciated. Thanks! Answer You can use DataFrame.groupby
Read a TSV file from a remote server
I have this function which returns the path to the file I need to read Later on, I am trying to open the file db_file holds one of the paths above. When I execute the script I get this error: I have checked the files names and the paths they all exist and in the right location. I have tried
Calculate time between two different values in the same pandas column
I have data that look like the following I need to create a new column that will find the time between the first issue and the first resolved. I need a groupby statement that will keep the first issue and the first resolved for all the issues. Then find the time – When I use group by Device and condition
Python – How to create a delete function for user input?
I’ve been trying to create a program which allows users to view a text file’s contents and delete some or all of a single entry block. An example of the text’s file contents can be seen below: As such, the entry block refers to all lines without a horizontal space. Currently, my progress is at: The delete_function() is meant to
Why isn’t the program closing after the fade animation?
I am new to python and I came up with this idea on how to make the page fade out by controlling the wm_attributes of my GUI program. I made this code which decreases the amount of ‘a’ by 0.1 each iteration then the program goes to sleep for 0.1 second to create this fade effect. After the page was