Skip to main content

All Questions

Tagged with
0 votes
0 answers
99 views

Column value update issue

import pandas as pd import numpy as np from itertools import combinations data = {'FFC': [200, 52880], 'CLUB': [0, 0], 'PBC': [200, 0], 'ESC': [200, 0], 'LPLC': [250, 0], 'FPLC': [...
arvin's user avatar
  • 17
0 votes
1 answer
52 views

Incorrect behavior of Spyder or Pandas when calling function DataFrame.info()

I'm using Spyder. Creating some dataframe with Pandas: import pandas as pd import numpy.random as npr npr.seed(0) df = pd.DataFrame(npr.randint(1, 10, size=(3,4))) I get a strange behavior when using ...
mins's user avatar
  • 7,594
0 votes
1 answer
48 views

I'm getting strange, repeated results using spaCy and pandas

I'm making a bot that solves the New York Times "Connections" game. I'm trying to make a matrix that has the cosine similarities of words so that I can check to see which ones are most ...
Sendagaijin's user avatar
-1 votes
1 answer
53 views

Python function for plotting distributions works with one DataFrame but not another - no output or error

I have the following python function to make graphs. def plot_distributions(dataframe, title=None): # Set the style of seaborn sns.set(style="whitegrid") # Plotting ...
arrabattapp man's user avatar
-1 votes
1 answer
130 views

Debugging a very large dataframe in pandas using Jupyter Notebool

I have a csv file with a column 'record' that has dictionaries (variable sized) as values and they are saved as 'str'. I read the file in a dataframe and am trying to get the dictionary keys separated ...
Fariha Baloch's user avatar
0 votes
0 answers
282 views

Backtrader library not properly calculating trades

I am using backtrader in python to use for my strategy. I already tried printing the parts where the errors might have occured but I still haven't figured this out. The title might be wrong as well ...
aspiring_algo's user avatar
2 votes
1 answer
366 views

Using map to convert pandas dataframe to list

I am using map to convert some columns in a dataframe to list of dicts. Here is a MWE illustrating my question. import pandas as pd df = pd.DataFrame() df['Col1'] = [197, 1600, 1200] df['Col2'] = [...
honeybadger's user avatar
  • 1,585
0 votes
0 answers
100 views

Why pandas cannot read my column name in excel? How to solve this problem?

Traceback (most recent call last): File "<ipython-input-51-afc09c056d5a>", line 1, in <module> runfile('C:/Users/Jamie Tsoi/OneDrive/Desktop/FYP/office hourly.py', wdir='C:...
not_python_expert's user avatar
0 votes
1 answer
40 views

Pandas list comparison giving value error

I have a dataframe I generate by using df = qr_actions.get_pandas_df(query) and then generate a list of the rows using rows = [r[1] for r in df.iterrows()] and am trying to compare it to another list ...
monique's user avatar
  • 11
1 vote
1 answer
44 views

the else block in the following code isn't working and only the if statement is being executed to calculate the volume. What is going wrong?

def volume(df): for i in range(len(df['depth'])): if df['depth'][i] > 60 : df['volume']=df['x']*df['y']*df['z'] else: df['volume'] = 8 return df I am working to calculate volume of a ...
dsnoob27's user avatar
0 votes
1 answer
83 views

Bypassing and printing out the name of an Error in a Loop - Python [duplicate]

Although I know it is not good practice to bypass an error, I'm trying to figure out in which of the data sets that I am working one, I get an error. I am looping through all of the Data Sets, and ...
João Roquette Saldanha's user avatar
1 vote
0 answers
2k views

TypeError: join() takes no keyword arguments

I'm trying to concatenate a list of columns based on a condition inside a class. I tried this piece of code outside the class df1[col_list].astype(str).apply("_".join,axis=1)and it is ...
NAS_2339's user avatar
  • 363
0 votes
0 answers
199 views

Enter Python debugger on an exception ignored by a library

I have introduced a bug in some complicated code which is noisily swallowed by some library code I don't want to learn about: In [212]: start = time() ; result = big_messy_thing() ; stop = time() ; ...
rob's user avatar
  • 393
2 votes
1 answer
640 views

How do you place a breakpoint inside a python package?

I'm working on contributing open source to the pandas package inside python. When I run import pandas as pd, it points to the installed version of python. Wondering the best way to import the local ...
Jason Bian's user avatar
0 votes
0 answers
222 views

UnicodeDecodeError again: 'utf-8' when debugging Python files in PyCharm Community

Current conclusion: The encoding of the converted file is utf-8->utf-8 big->ansi -> utf-8. Reopen the file after each conversion. After observing for a period of time, there is no such error. ...
jaried's user avatar
  • 672

15 30 50 per page