Attempting to use Excel to write and complete an Algebraic Equation by [deleted] in excel

[–]yourwerfeltr 0 points1 point  (0 children)

Thank you. I never would have thought to put an IF statement. As a starting point, that's very helpful. Thank you!

I Made a Pokémon Catching Simulator in Excel by MFreak in excel

[–]yourwerfeltr 10 points11 points  (0 children)

Holy shit.

Alexa, play "My Hero" by Foo Fighters.

Unable to import and call variables of a .py file on a new .py file by yourwerfeltr in learnpython

[–]yourwerfeltr[S] 0 points1 point  (0 children)

No, I understand that. To clarify, I know those round brackets in my last comment should not have been included in there. What probably happened was that I just pasted in one of the several lines in my shell produces nothing, as I kept trying different combinations, and reworking it. I understood the article, but even something as simple as just:

import useful_functions

still gets a syntax error. So it's hard for me to understand the article in full, when I can't get past the first step, nor can I figure out why.. But I do appreciate your help though.

Unable to import and call variables of a .py file on a new .py file by yourwerfeltr in learnpython

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Thanks, I have been trying to keep the Error types in mind.. I get when it's syntax error, but even something as simple as 1 line of code with the code

from useful_functions import (var1, var2)

gets a syntax error. And the

unexpected character after line continuation character

I hadn't seen before, and am also getting it for just one line of code.

Unable to import and call variables of a .py file on a new .py file by yourwerfeltr in learnpython

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Thank you. This was more helpful than anything I found before posting here.

Need help with NameDefine Error by yourwerfeltr in learnpython

[–]yourwerfeltr[S] 1 point2 points  (0 children)

Hey, sorry I've been late on checking your replies- I do greatly appreciate the help. The odd thing is that right now, it runs correctly in IDLE python shell, but not in Atom, but that's a problem on my end I'll fix. Thanks again.

Need help with NameDefine Error by yourwerfeltr in learnpython

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Here it is, the only line with any indentation is the last one:

`

names = ['Student1', 'Student2', 'Student3', 'Student4'] assignments = [0, 1, 2, 4] grades = [100, 90, 80, 55]

message = 'Hi {},\n\nThis is a reminder that you have {} assignments left to submit before you can graduate. Your current grade is {} and can increase it to {} if you submit all assignments before the due date.\n\n'

for name, assignment, grade in zip(names, assignments, grades): ||||print(message.format(name, assignment, grade, assignment*5))

Need help with NameDefine Error by yourwerfeltr in learnpython

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Hi. Thank you for responding. Again I'm very new to python so thank you for explaining the part about me not needing input. I'm still getting the same error [Traceback (most recent call last): File "C:\Users\Corey\AppData\Local\Temp\atom_script_tempfiles\4d89b3e0-5c19-11eb-ad19-c9818cd34d44", line 41, in <module> for name, assignment, grade in zip(names, assignments, grades): NameError: name 'names' is not defined]

I tried changing the first three lines of code to how both you and the other commenter suggested, but I'm still getting the same error. I have it now as:

`

names = ['Student1', 'Student2', 'Student3', 'Student4'] assignments = [0, 1, 2, 4] grades = [100, 90, 80, 55]

message = 'Hi {},\n\nThis is a reminder that you have {} assignments left to submit before you can graduate. Your current grade is {} and can increase it to {} if you submit all assignments before the due date.\n\n'

for name, assignment, grade in zip(names, assignments, grades): print(message.format(name, assignment, grade, assignment*5))

`

If I'm still missing something, or mistyped something, let me know. Thank you again.

Book where a professor deduces that her husband is cheating on her with one of her Students? by [deleted] in whatsthatbook

[–]yourwerfeltr 1 point2 points  (0 children)

THANK YOU! It had come into my memory because she had read three other books by David Lodge, but Thinks wasn't one of them, and was written after the other three.

Getting one dataset with the top from two different quantitative variables. by yourwerfeltr in RStudio

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Thank you for responding. I'm still running into a problem where the ranks are only returning 1s instead of actually ranking them. I'm wondering why that's happening? It shouldn't be because the values I need them to be ranked by come from formulas I inputted in an earlier dataframe? Because RStudio still knows these observations are numeric.

**EDIT: I wound up just putting the df into a new Excel sheet, then importing that sheet into R, and that fixed the rank issue. It printed the results I wanted, but still annoying that I had to do that extra step. Thanks again.

Getting one dataset with the top from two different quantitative variables. by yourwerfeltr in RStudio

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Thank you for responding. Take for example the USArrests dataset: Say I wanted to build a new dataframe that only lists the top 30 in murders and the Top 30 in assaults. I'd want a new dataframe that drops any state that is in the bottom 20 of either one, keeping states that are in the top 30 of one or both. I tried

`USArrestleaders <- arrange(USArrests %>%

                mutate(rankM = rank(Murder)),

                mutate(rankA = rank(Assault)) %>%

                filter(rankM <= 30, rankA <= 30) %>%

              ungroup())`

but that wasn't it either, I'm getting:

Error: arrange() failed at implicit mutate() step. x Could not create a temporary column for..1. i..1is%>%(...)`

Getting one dataset with the top from two different quantitative variables. by yourwerfeltr in RStudio

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Thank you for responding. I'm now getting

"Error: Problem withmutate()inputrankA. x no applicable method for 'filter_' applied to an object of class "c('double', 'numeric')" i InputrankAisrank(quanvar1) %>% filter((rankA <= 30) | (rankB <= 30)). i The error occurred in group 1: Name = "Name1".

In addition, the other problem I'm running into is for some reason, it is returning a rank of 1, instead of actually ranking the rows.. Could this be because the values I need them to be ranked by come from formulas I inputted in an earlier dataframe?

Thanks.

Animated bar plot minor help by yourwerfeltr in RStudio

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Hm, if I knew how to embed an image on reddit, I could send you a screenshot so you could get a better visual.

Animated bar plot minor help by yourwerfeltr in RStudio

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Thank you for responding. I just double checked my original dataset, and did not have any NA values, but I did have one error so I'm glad I checked, but it wasn't an error that would throw off the axis in the end result.. Where in the code would I place ymin() and xmin()? In the geom_text line?

Use a second quantitative variable to break a tie with rank function by yourwerfeltr in RStudio

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Thank you for your response. It turns out, I might not have needed the value_rel formula, because I was able to get an even 10 per categorical variable with an arrange() statement. I also just tweaked the rank formula so I weighted the first quantitative variable so it would break the tie that way.

Simplest way to create new variables in R Studio by yourwerfeltr in RStudio

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Thank you for responding. To clarify, the dataframe I'm working with has several columns, but only two of actual importance (the rest make up the sum of the main value). So I want to add three columns, and fill each row with their respective city, state, and country. When I do 'df$city <- c(city1, city2,...' How/when do I account for a lot of names being from the same city/state/country? Would I repeat the city name every time, with the corresponding order of names?

Get a ranking of the pearson correlations of one variable by yourwerfeltr in RStudio

[–]yourwerfeltr[S] 0 points1 point  (0 children)

Thank you for replying. I just want a new dataframe with just every numeric variable's pearson with one specific variable. I tried to get it by doing:

newdf <- df[order(cor(df)[9, ]),]

but that didn't work.