Linked Questions

0 votes
0 answers
56 views

I am working on an assignment that is meant to help me familiarize myself with pandas, and the portion I am stuck on wants me to find the sample variance of Y. It says I must draft the Python/Pandas ...
Austinite's user avatar
171 votes
21 answers
403k views

I'm using python (Django Framework) to read a CSV file. I pull just 2 lines out of this CSV as you can see. What I have been trying to do is store in a variable the total number of rows the CSV also. ...
GrantU's user avatar
  • 6,565
244 votes
9 answers
98k views

I am generally confused about the difference between a "property" and an "attribute", and I can't find a great resource to concisely detail the differences.
Carson's user avatar
  • 17.9k
134 votes
11 answers
241k views

I need the index to start at 1 rather than 0 when writing a Pandas DataFrame to CSV. Here's an example: In [1]: import pandas as pd In [2]: result = pd.DataFrame({'Count': [83, 19, 20]}) In [3]: ...
Clark Fitzgerald's user avatar
39 votes
6 answers
272k views

Obviously new to Pandas. How can i simply count the number of records in a dataframe. I would have thought some thing as simple as this would do it and i can't seem to even find the answer in ...
IcemanBerlin's user avatar
  • 3,477
19 votes
4 answers
906 views

I am trying to concat multiple Pandas DataFrame columns with different tokens. For example, my dataset looks like this : dataframe = pd.DataFrame({'col_1' : ['aaa','bbb','ccc','ddd'], ...
Aaditya Ura's user avatar
  • 12.8k
11 votes
1 answer
2k views

The following: timeit print("foo") returns something like: 100000 loops, best of 3: 2.35 µs per loop. I guess the 100000 relates to number argument of timeit. I don't understand what is best of 3 ...
Dror's user avatar
  • 13.2k
3 votes
1 answer
7k views

Coming from a SQL environment, I am learning some things in Python Pandas. I have a question regarding grouping and aggregates. Say I group a dataset by Age Category and count the different ...
SQL_M's user avatar
  • 2,485
4 votes
1 answer
3k views

How could i fix this error: TypeError: object of type 'generator' has no len() Thanks! for index, row in df_result.iterrows(): if index == 0: tempIndex = 0 else: if row['LEADID'] == df_result....
wenqi lin's user avatar
7 votes
3 answers
1k views

I'm trying to understand how to identify statistical outliers in groups of dataframe. I will need to group the rows by the conditions and then reduce those groups into a single row and later find the ...
Aaditya Ura's user avatar
  • 12.8k
0 votes
1 answer
5k views

I have a very large pyspark dataframe and I would calculate the number of row, but count() method is too slow. Is there any other faster method?
Luigi's user avatar
  • 411
-1 votes
1 answer
2k views

whenever I try to use len function in my code I get this error ? long_trade={} short_trade={} long_trade['total_long']=get_total_long(long_df,len(long_df)) short_trade['total_short']=get_total_short(...
Vishal Naik's user avatar
1 vote
1 answer
1k views

I have two pyspark dataframe tdf and fdf, where fdf is extremely larger than tdf. And the sizes of these dataframes are changing daily, and I don't know them. I want to randomly pick data from fdf to ...
Neuronix's user avatar
0 votes
3 answers
2k views

so im trying to use pandas instead of a for loop to count the number of movies in a given range of year. Assume by data frame has 2 columns and 'year' is the column name at column 2 I solved it using ...
clumbzy1's user avatar
  • 105
0 votes
1 answer
1k views

I'm just trying to get a count of rows for a values in a given column, for example: CSV Data: 'Occupation','data' 'Carpenter','data1' 'Carpenter','data2' 'Carpenter','data3' 'Painter','data1' 'Painter'...
NealWalters's user avatar
  • 18.5k

15 30 50 per page