I´m trying to do the following: when I upload a file in my s3 storage, the lambda picks this json file and converts it into a csv file. How can I specify in the lambda code which file must pick? example of my code in local: in this example, I provide the name of the file…but..how can I manage that
Category: Questions
Replacing values in a pandas dataframe taking row number into account
I have this dataframe taken from an excel file and I want to replace the value column with a string that contains the row number (+1 and with an F so it reference another cell in excel) if the state is “no”. I had no problem replacing some values in the comment column with but I dont know how take
How do I loop through a pandas dataframe, check to see if the data type of each column is a float number, then replace null values with mean?
I am trying to iterate through a pandas Dataframe which has columns with different data types, and replace them with different data types based on their null values. This code did not work as the null values are not replaced in the dataframe. Answer fillna() doesn’t normaly edit your dataframe. you have 2 ways: or:
How to deny letters and symbols in loops
I only want my code to accept numbers between 1 to 9. I tried try except, logical operators, isdigit, but I just can’t do it. Answer It look like you’re trying to print out the prompt based on the user input, and you want to make sure that it’s not higher the 9 and lower than 1. You need to
How to read tsv file from vaex and output a pyarrow parquet file?
On these vaex and pyarrow version: When reading a tsv file and exporting it to arrow, the arrow table couldn’t be properly loaded by pyarrow.read_table(), e.g. given a file, e.g. s2t.tsv: The file looks like this: And when I tried exporting the tsv to arrow as such, then reading it back: It throws the following error: Is there some additional
How can I extract specific value from JSON response?
Hi I am trying to get value from JSON response which Im getting from GitLab API. Code should extract “commiter_name” value but it does not work, already tried several options from internet. Error: Answer This is because you did not include you api token in the header. Also please check that the website you are pointing to in the request
How to Make Coordinates on Sympy Cartesian Graph
I’ve browsed everywhere but there is no answer that can be used as a reference for making coordinates on a sympy python Cartesian graph. Here and here I’ve studied but still can’t solve the problem I found in my code. I want a = 1 and b = 3 to be connected to the x and y axes. Any help
Get index of row where pandas column contains regex
I am checking to see if a pandas column matches a pre-defined regex, using .any() to get the first match if found. However, I need to return the index/row where this match occurred so that I can get the value of another column in that row. I have the below to check where the reg_ex pattern exists in df[‘id_org’] Once
Python: List of dictionaries – using keys as headers & rows are the values (Naive way)
I’m currently tasked with creating a CSV file from a list of dictionaries where the headers are the dic keys and the rows the dic values Ex. Output would be a CSV File: We’re not allowed to use dictwriter/csv/pandas and have to do it the naïve way. I currently have the keys gathered, but am struggling with trying to split
How do I route my databases in Django based on which user is logged in?
I am making a django website and I want each user to have their own database, for example now I have 2 databases hosted on azure, and in my settings.py file I have this: I have a folder called users, and within that I have a file called Fields that includes this: So I want people to login and see