Categories
Linux Mastering Development

Bluetooth keeps changing from A2dp to headset and loses connection on Debian Buster with JBL 4 Speaker

since over a year I am having trouble with the bluetooth connection to my JBL 4 speaker. It looses connection again and again. I created a script according to what I found on the internet to reconnect via keyboard short cut. Sometimes it is connected with it within a view seconds sometimes I had to […]

Categories
Mastering Development

invalid argument 0: Sizes of tensors must match except in dimension 0. Got 150 and 160

img_batch-> torch.Size([128, 3, 150, 150]) y_batch torch.Size([128]) I got this error RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 150 and 160 in dimension 2 at /pytorch/aten/src/TH/generic/THTensor.cpp:689 > ————————————————————————— RuntimeError Traceback (most recent call > last) <ipython-input-35-7c351d115c60> in <module> > 24 gc.collect() > 25 > —> 26 train_model(epoch, optimizer, […]

Categories
Mastering Development

How do I return large number of columns from mysql database using AWS Lambda?

A brief background: I have a serverless mysql database connected to AWS RDS which consists of 70 columns and 7000+ rows. Many of the columns defined in this RDS have datatype as VARCHAR(2000), BIGINT. I’m trying to return all the details in this database using an AWS Lambda api, following is the code snippet of […]

Categories
Development

How to fix “ModuleNotFoundError: No module named ‘_lzma’ ” issue in google cloud console

This is the error i am getting: Traceback (most recent call last): File “reader.py”, line 5, in <module> import pandas as pd File “/usr/local/lib/python3.7/site-packages/pandas/__init__.py”, line 55, in <module> from pandas.core.api import ( File “/usr/local/lib/python3.7/site-packages/pandas/core/api.py”, line 24, in <module> from pandas.core.groupby import Grouper, NamedAgg File “/usr/local/lib/python3.7/site-packages/pandas/core/groupby/__init__.py”, line 1, in <module> from pandas.core.groupby.generic import ( # noqa: […]

Categories
Development

OSError: Unable to open file (file signature not found) / End of HDF5 error back trace

I have a small (< 6Mb) .hdf file (obtained from the LAADS DAAC service). I have tried pandas and h5py to open it, to no avail (code shown below). I also tested the file with: $ h5dump -n data.hdf h5dump error: unable to open file “data.hdf” and $ h5debug data.hdf cannot open file This would […]

Categories
Development System & Network

Broken yum installation

I tried to update my CentOS on my server using yum update but I get the following error: Traceback (most recent call last): File “/usr/bin/yum”, line 4, in <module> import yum File “/usr/lib/python2.7/site-packages/yum/__init__.py”, line 59, in <module> import config File “/usr/lib/python2.7/site-packages/yum/config.py”, line 30, in <module> from parser import ConfigPreProcessor, varReplace File “/usr/lib/python2.7/site-packages/yum/parser.py”, line 4, in […]

Categories
Development Linux Ubuntu

How to fix native python/pandas problem: TypeError: descriptor ‘__subclasses__’ of ‘type’ object needs an argument

I have a fresh install of Ubuntu 16.04.6 and after I install a few python packages (listed below), and enter Python3 and type import pandas, I get this error: myBashPrompt:~$ python3 Python 3.5.2 (default, Oct 8 2019, 13:06:37) [GCC 5.4.0 20160609] on linux Type “help”, “copyright”, “credits” or “license” for more information. >>> import pandas […]

Categories
Development Linux Ubuntu

How to safely reinstall native Python on Ubuntu 16.04?

After I did a routine update of Ubuntu 16.04.6 and installed pandas using pip3, pandas crashes when I import it. Simply opening up Python3 and typing import pandas is enough to throw the below error (although what I’ve shown below is the same error when I run my program that imports pandas). Is there a […]

Categories
Development

Reading csv file into Pycharm incurred error

I just want to read a csv file into Pycharm but due to some reason it’s not doing it properly. Here is my code: import csv import os import pandas as pd path = ‘/Users/amy/Desktop/data_analysis/additionaldata/df1.csv’ df=pd.read_csv(‘path’, sep=’,’) It returned error Traceback (most recent call last): File “<input>”, line 3, in <module> File “/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py”, line […]

Categories
Development

How to put string data from file into integer form for a formula

I’m ranking the top 10 basketball players in the NBA by points, minutes, free throws, and efficiency. All rankings work except efficiency now. I get an error when I run my function: formula = (player[17] – player[18]) + player[13]))/(player[4])) Traceback (most recent call last): File “”, line 1, in main() File “C:/Users/panda/OneDrive/Desktop/Homework/CS HW 9/pa09.py”, line […]