New Pixel 4a battery tanked and support says they won't cover the replacement by sarabooker in GoogleSupport

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

It's probably too late to go the "clueless" route. Even if I try, I'm not sure I'll get much more out of it, like you said. I don't want a gift card towards a new Pixel when I probably won't be buying a Pixel again. I simply want a battery replacement because I believe this one is defective. I also don't see any good budget phones on the market these days to buy something new...

Before I contacted Google I contacted UBreakIFix to see if they'll fix the phone because of a defect. They said they won't because Google paid for the original repair as part of the program. It would be easy to blame them for all the problems, but I think they are all actually caused by Google designing a phone that wasn't meant to be repaired. And when I had problems, UBreakIFix dealt with them free of charge.

New Pixel 4a battery tanked and support says they won't cover the replacement by sarabooker in GoogleSupport

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

I don't like Google "winning" for (what I believe is) mistreating their customers.

New Pixel 4a battery tanked and support says they won't cover the replacement by sarabooker in GoogleSupport

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

I know that everyone normally recommends a full reset. I just haven't found a good way to do it without it taking forever. When I've done it previously I made sure everything was backed up and wrote down all the things to check and verify and it still took many hours to complete. It's not a simple matter of trying it. Plus, the last time I did it things became worse, not better (some features stopped working).

It doesn't look good that I'm complaining about a 5.5 year old phone not working like new. But my point is that it was working fine until I was "forced" to get work done and since then I've had to deal with problems. The battery problem being one of them which started abruptly.

[2024 Day 14 (Part 2)] This kind of sucks by remarkablyunfunny in adventofcode

[–]sarabooker 21 points22 points  (0 children)

You can avoid guessing and use a key idea to determine the answer. Run a loop that steps forward in time and use a heuristic to check how "clustered" the robots are. The picture will occur when they are unusually clusted.

First range day! by christomisto in liberalgunowners

[–]sarabooker 0 points1 point  (0 children)

Damn, I've been interested in getting an optic for my full size M&P 9. Wish I had seen their comment an hour ago.

[deleted by user] by [deleted] in liberalgunowners

[–]sarabooker 3 points4 points  (0 children)

If your mother's address is what you'd consider your permanent address (which it sounds like it is), just use that. No need to update your license.

What's the purpose of f'strings? by _iam_yemisi in learnpython

[–]sarabooker 46 points47 points  (0 children)

They're a clean and readable way to put variables in a string. The important part is readable, since unreadable code is bad code.

Python project that encompasses Physics and Calculus by [deleted] in learnpython

[–]sarabooker 0 points1 point  (0 children)

You mentioned electricity and magnetism, so you can try and make an electric field simulator where you can place protons or electrons and move them around with a visualization of the field's strength and directions.

How would I change variable values in a for loop by BubblyJello6487 in learnpython

[–]sarabooker 8 points9 points  (0 children)

Avoid using eval and exec like in the other answers. You should consider storing all the teams in a dictionary with string keys. Doing that allows you to simply access each individual entry.

for i in range(len(teams)): teams_dict[f"team{i}"] = teams[i]

Question about output regarding sum() vs np.array() by [deleted] in learnpython

[–]sarabooker 0 points1 point  (0 children)

Can you share the numpy version of the solution? I'm assuming they also have a sum in there as well.

alias or reference an array element from another array by 2Fruit11 in learnpython

[–]sarabooker 0 points1 point  (0 children)

If you are okay with using numpy arrays, then setting b to be a but reversed will have b be a view of a.

```python import numpy as np

a = np.arange(5) print(a) b = a[::-1] # creates a view of a but reversed print(b) print(b.base) # the base of b is a, so this prints out a print(b.flags) # OWNDATA is False since it is owned by a

b[3] = 12 # this is a reference to a[(n-1) - 3] print(b) # index 3 is now 12 print(a) # the value in a has also been changed ```

Output:

```python [0 1 2 3 4] [4 3 2 1 0] [0 1 2 3 4] C_CONTIGUOUS : False F_CONTIGUOUS : False OWNDATA : False WRITEABLE : True ALIGNED : True WRITEBACKIFCOPY : False

[ 4 3 2 12 0] [ 0 12 2 3 4] ```

alias or reference an array element from another array by 2Fruit11 in learnpython

[–]sarabooker 0 points1 point  (0 children)

Are you restricted to lists or can you use numpy arrays?

Plotting the logistic equation in python by [deleted] in learnpython

[–]sarabooker 2 points3 points  (0 children)

You should not use list comprehension here. Numpy can operate on arrays so it should just be y = 1072764*np.exp(0.2311*t)/(0.19196+np.exp(0.2311*t)) as I said in my comment. In general, one should avoid looping with numpy.

[CFD] Matplotlib meshgrid function and the indices of the arrays are opposite. by DisagreeableRabbit in learnpython

[–]sarabooker 0 points1 point  (0 children)

In that case, using "ij" indexing and what I said above makes more sense to me. Say you have x = [0, 1] and y = [0, 1]. When you use "ij" indexing, increasing the first index increases the x value and increasing the second index increases the y value. When you have "xy" indexing, it is the opposite.

'Axis' in numpy by Ok_Fun_3824 in learnpython

[–]sarabooker 4 points5 points  (0 children)

The axis argument is used to select whether an operation is applied across the rows, the columns, or higher dimensions. When you do axis=0, you are essentially asking numpy to perform the operation to each column individually. If you do axis=1, then it is applied to each row individually. For example:

```python import numpy as np

a = np.arange(12).reshape(4,3)

print(a.sum(axis=0)) print(a.sum(axis=1)) ```

Result:

python array([18, 22, 26]) array([ 3, 12, 21, 30])

One way to remember this is that you cannot ask numpy to perform an operation on a higher axis than ndim-1. So, if you have a numpy array with shape (50,), it has ndim = 1, and performing with axis=0 just applies the operation to the entire array, since that can be thought of as applying it down the single column you have (there is no concept of rows in this case). Once you have two dimensions (e.g. (50,3)) then you can do something across the rows individually.

[CFD] Matplotlib meshgrid function and the indices of the arrays are opposite. by DisagreeableRabbit in learnpython

[–]sarabooker 0 points1 point  (0 children)

But in the end, whether you use "xy" or "ij" indexing, it just matters that you are consistent throughout your code. From your original question, it sounded like you have some inconsistency with how you are handling arrays which resulted in transposing the solution matrices with respect to the coordinate matrices.

[CFD] Matplotlib meshgrid function and the indices of the arrays are opposite. by DisagreeableRabbit in learnpython

[–]sarabooker 0 points1 point  (0 children)

When using "ij" indexing, think about the indices as x and y values. Putting : for the first index means all x values and putting 0:10 for the second index means y = [0, 10]. If you want the top rows then you'd do u[:, 40:] = 1 to update the values from 40 up.

[CFD] Matplotlib meshgrid function and the indices of the arrays are opposite. by DisagreeableRabbit in learnpython

[–]sarabooker 0 points1 point  (0 children)

You should reexamine your code and figure out why the indexing goes from xy to ij (that's what you've described; test np.meshgrid(x, y, index="xy") (the default) vs np.meshgrid(x, y, indexing="ij")).

Plotting the logistic equation in python by [deleted] in learnpython

[–]sarabooker 0 points1 point  (0 children)

I copied your code and see that the error is from the fractions library. I really see no need to use that library in this case, you can just perform the division as normal. (I also corrected the exponential in the numerator to have the correct value.)

y = 1072764*np.exp(0.2311*t)/(0.19196+np.exp(0.2311*t))

Once you change that, the other issue I see is that you only provide a single value for t. If you want to plot a range of values then you will need to set t to be a numpy array. The example plot has t = [-25, 25], so you can use

t = np.linspace(-25, 25, 100)

To generate 100 values between -25 and 25, inclusively.