I have created an automated data client that pulls data from a txt file and inputs it into a csv file. Each data entry contains a timestamp, but it is not in the format I need it in, I need it to match the datetime.now() format: ORIGINAL FORMAT [03/11/22 01:06:09:190] DESIRED FORMAT 2022-11-03 01:06:09.190000 I am currently using the following
I would like to keep this same code but adjust the .to_csv section to save a variable repeating file name I would like the names of the exported files to look like this…I think I need some sort of loop? Period 1 layer 1.csv Period 1 layer 2.csv Period 1 layer 3.csv Period 1 layer 4.csv Period 1 layer 5.csv
I want to send DF2 to DFn to matchparts function.. I tried sending it using matchparts(DF1, “DF”+ str(cnt)) the function recieves it as string rather than a DF Answer There are basically 3 ways in which you can do this : Using dictionary Using globals() Using eval(Not recommended) Say you have dataframe in multiple variables, say DF1, DF2, DF3. Using
Using tkinter to select output folder for processed files. Would like to use file_output and x as variables for my file path, My attempt: This does not work in my program. The output I need is I am reading the docs https://docs.python.org/3/reference/lexical_analysis.html#grammar-token-stringprefix Still don’t understand how to escape or a workaround, Help would be much appreciated. Answer you can easily
I’ve stumbled on what is probably a simple issue but I struggle to think of a solution. If I try to make a class variable that equates to a number or an array index they come up with these errors and This seems odd since I can set variables equal to ints and arrays elsewhere. What am I missing and
I’m trying to write a modular script, with functions -Function 1 age = input(“tell me your age : “) -Function 2 weight = input(“tell me your weight : “) -Function 3 birthday = input(“tell me your birthday : “) at the end, i want to send a mail outside functions like : mail_body = age + weight + birthday Thanks
The purpose is to calculate the average value (AverageU) from a starting array (StartingU) The for loops that calculate the average values for AverageU Output: The problem is why StartingU gets updated? It should be unchanged Answer AverageU changed since this code, not after for loop. AverageU and StartingU are the same instances. You can check it with is function.
I’m not sure how to assign a slot to a variable in an Alexa skill. I’ve found several tutorials, but most of them are in JS (I wrote this code in Python) or outdated, since even using them precisely as presented does not work. Alexa is meant to ask for one of my kids’ names so I can implement a
The code below takes dna_string2 and matches it within dna_string1. It then outputs the index location of the match or matches and then increments then return value by 1 to simulate “counting itself”. The problem I am facing is that I need the output values of 2, 4, and 10 to be assigned to their own variables. I cannot figure
I have the following situation, could you help me? I would like to leave some dynamic data (variables) inside my .sql file and execute my test correctly in .robot file. However, when I go to do my test, it returns an error, that is, the variable is not mounted correctly. I think I’m leaving something “behind”. Could anyone help me?