Skip to content

Tag: python

how to manage file for import in Python?

I want to get a common library from several files. In order to reduce the amount of code, I want to create and manage a separate file for import. Will it be possible? import_lib.py other_1.py other_2.py Answer Don’t try to hide the imports needed in your module in another module – it’ll make…

Calculator not functioning properly

Hey I’m trying to make a small calculator for a project, however I’m struggling to get the code to work. When I try to run operation 4, I want the code to ask if you would like to run another calculation, if you answer with ‘yes’ it will repeat the statement again. However all it does …

Json to CSV file conversion using python

I have a sample JSON file like this i need to take only specific key and values from the json file and convert it into a CSV file Code: Ref:Extracting Specific Keys/Values From A Messed-Up JSON File (Python) When I’m passing 2 values through the extract(), getting NaN in between result I need to get an …

Passing multiple dataframes as arguments to a function

I have been scratching my head since morning on how to tackle this problem. I need to pass multiple columns from multiple dataframes to a function as arguments. Example : Df1 A B C 1 11 111,333 2 22 222 3 33 nan Df2 D E a 111 b 333 Now, I want all the rows from Df2(col E) which