Unable to load S3-hosted CSV into Spark Dataframe on Jupyter Notebook. I believe I uploaded the 2 required packages with the os.environ line below. If I did it incorrectly please show me how to correctly install it. The Jupyter Notebook is hosted on an EC2 instance, which is why I’m trying to pull the CSV from a S3 bucket. Here
Tag: jupyter-notebook
How to properly use Smote in Classification models
I am using smote to balanced the output (y) only for Model train but want to test the model with original data as it makes logic how we can test the model with smote created outputs. Please ask anything for clarification if I didn’t explained it well. It’s my starting on Stack overflow. Here i applied the Random Forest Classifier
how to programmatically add slides cell metadata in jupyter notebooks?
Jupyter notebooks has a way of visualizing cell metadata so that you are able to parametrize how will cells look like when you export the notebook into slides using nbconvert. Example: For instance, I would like to programmatically add that metadata into cells without using the GUI, so that I can automate slide creation, specially from google colaboratory as it
Converting .py files to .ipynb
My organisation converts any Jupyter Notebooks (.ipynb files) it makes into python scripts (.py files) for easier management in our repos. I need to convert them back so I can run the notebooks but can’t work out how. I believe they’ve been encoded using the nbconvert package but I couldn’t find a way to convert the files back in the
Why am I receiving this error? This date function has worked fine in my overall script until today
I am using this date function in a python script of mine and it has been working for months. Now, as of this morning it is not working. Here is an image of the error that I receive when I try and run the function. I receive the error in script when running date function by itself. date function that
Importing module on python / jupyter
I made very simple test.py -file and I want to use it as module: When I run another notebook and try to import it, the import is “succesful”. However, when I run my code it comes back: I can by-pass this by editing my code: and then it will work. I do not quite understand why I can’t run the
Why the rank function is not working when I set axis=1?
I have this code: The code is working as it is but is not returning What I want. I was trying to rank num considering only it’s row so I tried to change this line: to: But it didn’t work. What am i missing here? Answer Building on what you already have here: we could add the Rank column as
Sum values of a coulmn in specific rows in a dataframe
I would like to learn how to specify a “subset-sum” in a dataframe My dataframe looks like this: The Data/Time column is the dataframes’ index With I get the total sum of column A. My aim is to sum up a subset of rows only like between 2022-03-18 07:37:51 and 2022-03-18 07:37:55 so that I get a “sum” row: How
SSL Error (Port=443) Max retries exceeded when trying to import osmnx data in Jupiter Notebook
When trying to run this line G = ox.graph_from_place(‘Piedmont, CA, USA’, network_type=’drive’) I get this error: I googled and found this could be a solution but I got the same error message: (I changed my/app_1 to “ABC” in the code above) I also tried – since that was in another solution on stackoverflow, this: but the same SSL-error appeared. I’m
Sum multiple rows of dictionaries in a dataframe, based on condition
How can I add the values and keys of multiple dictionaries based on having the same isolate name? Example dataframe: Isolate dictionary VM20030364 {‘L’: 200, ‘V’: 500, ‘T’: 300, ‘A’: 400, ‘S’: 1} VM20030364 {‘L’: 200, ‘V’: 600, ‘T’: 300, ‘A’: 450} VM20030364 {‘L’: 100, ‘V’: 400, ‘T’: 300, ‘A’: 400, ‘S’: 1} UNKNOWN-UW-1773 {‘L’: 500, ‘V’: 360, ‘T’: 340,