dataset

Panda not printing all of the table

Panda not printing all of the table Question: This is my first post so I hope I don’t forget anything. So I was trying to scrape all of the UFC events to see certain stats of fighters and I tried using Pandas. This is where my problem started, so when I imported the website using …

Total answers: 1

How to remove some labels of a pytorch dataset

How to remove some labels of a pytorch dataset Question: I have a torchvision.datasets object. I only want to keep some labels and delete the others. For example, if my dataset is CFAR10 like this trainset = torchvision.datasets.CIFAR10(root=’./data’, train=True, download=True) I will have 10 labels. I only want to keep the first three labels and …

Total answers: 1

Python categorical variables NaN while creating box-plot

Python categorical variables NaN while creating box-plot Question: After I successfully created categorical values, their result is NaN. I used this command: df[‘Memory’]= pd.cut(pd.to_numeric(df[‘RAM ‘], errors="coerce"), [0,4,8,12], include_lowest=True, labels=[‘Basic’, ‘Intermediate’, ‘Advaced’]) After running df.head() here’s the table: When I try to box-plot them: sns.boxplot(x=’Memory’, y=’Price’, data=df[‘RAM ‘] = pd.to_numeric(df[‘RAM ‘], errors="coerce") ; df[‘Memory’]= pd.cut(df[‘RAM ‘], …

Total answers: 1

Python creating categorical variable error

Python creating categorical variable error Question: I need to create categorical variables for RAM category. Basic: RAM [0-4] Intermediate: RAM [5-8] Advanced: RAM [8-12] Command: df[‘Memory’]=pd.cut(df[‘RAM ‘], [0,4,8,12], include_lowest=True, labels=[‘Basic’,’Intermediate’, ‘Advaced’]) Error: TypeError Traceback (most recent call last) <ipython-input-58-5c93d7c00ba2> in <cell line: 1>() —-> 1 df[‘Memory’]=pd.cut(df[‘RAM ‘], [0,4,8,12], include_lowest=True, labels=[‘Basic’, ‘Intermediate’, ‘Advaced’]) 1 frames /usr/local/lib/python3.9/dist-packages/pandas/core/reshape/tile.py …

Total answers: 1

Python converting string "1+2" to float

Python converting string "1+2" to float Question: I’m beginner with Python, and I have problem with reading data from table. Program can’t convert string that contains addition of two numbers to float. I get error could not convert string to float: ‘6.8 + 3.9′ I’m converting with this command df[‘ScreenSize’].astype(np.float) Is there any way to …

Total answers: 1

How to efficiently process a large dataset with Python?

How to efficiently process a large dataset with Python? Question: I am currently working with a large dataset of approximately 100 million records, which is too large to fit into memory. I need to perform some operations on this dataset using Python, such as filtering, grouping, and aggregating. I have tried using Pandas and other …

Total answers: 1

How to compute one mean dataset of 4 datasets [Python, xarray]

How to compute one mean dataset of 4 datasets [Python, xarray] Question: I’m having 4 [GFS] temperature datasets: they are all the same in spatial resolution, the only difference is timestamp – they are for 00 UTC, 06 UTC, 12 UTC, 18 UTC within one day. I need to compute the mean daily temperature dataset. …

Total answers: 1

How to add a dataframe to another on python

How to add a dataframe to another on python Question: So I have 3 columns. ETA (eta/km*100) (a number), Climate, and month. My purpose is to drop the values higher that 0.95 quartile and lower than 0.05 (the extreme cases on this dataset) for each subset of 3 months and Climate, and the reagroup the …

Total answers: 1

Kaggle Data Clean Up

Kaggle Data Clean Up Question: I am trying to clean unwanted values from my dataset, I am currently trying to clean the gender column and there are a lot of ‘joke’ answers that I wish to remove but currently I only know how to remove these one by one. Is there a more efficient way …

Total answers: 1

Creating a dataset from 2d matrices

Creating a dataset from 2d matrices Question: I have a series of 2d matrices like these two: matrix_1 = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) matrix_2 = np.array([[10, 11, 12], [13, 14, 15], [16, 17, 18]]) And Each matrix has a label like: labels = np.array([0, 1]) I want to make a …

Total answers: 2