Top "Pandas" questions

Pandas is a Python library for data manipulation and analysis, e.g. dataframes, multidimensional time series and cross-sectional datasets commonly found in statistics, experimental science results, econometrics, or finance.

Shuffle DataFrame rows

I have the following DataFrame: Col1 Col2 Col3 Type 0 1 2 3 1 1 4 5 6 1 ... 20 7 8 9 2 21 10 11 12 2 ... 45 13 14 15 3 46 16 17 18 3 ... The DataFrame is read from a csv file. All rows which …

python pandas dataframe permutation shuffle
How to iterate over columns of pandas dataframe to run regression

I'm sure this is simple, but as a complete newbie to python, I'm having trouble figuring out how to iterate …

python pandas statsmodels
JSON to pandas DataFrame

What I am trying to do is extract elevation data from a google maps API along a path specified by …

python json google-maps pandas
Why isn't my Pandas 'apply' function referencing multiple columns working?

I have some problems with the Pandas apply function, when using multiple columns with the following dataframe df = DataFrame ({'a' : …

python python-2.7 pandas dataframe apply
pandas: merge (join) two data frames on multiple columns

I am trying to join two pandas data frames using two columns: new_df = pd.merge(A_df, B_df, …

python python-3.x pandas join
how to sort pandas dataframe from one column

I have a data frame like this: print(df) 0 1 2 0 354.7 April 4.0 1 55.4 August 8.0 2 176.5 December 12.0 3 95.5 February 2.0 4 85.6 January 1.0 5 152 July 7.0 6 238.7 June 6.0 7 104.8 March 3.0 8 283.5 May 5.0 9 278.8 November 11.0 10 249.6 October 10.0 11 212.7 …

python pandas sorting
Insert a row to pandas dataframe

I have a dataframe: s1 = pd.Series([5, 6, 7]) s2 = pd.Series([7, 8, 9]) df = pd.DataFrame([list(s1), list(s2)], columns = ["A", "B", "…

python pandas dataframe insert
Keep only date part when using pandas.to_datetime

I use pandas.to_datetime to parse the dates in my data. Pandas by default represents the dates with datetime64[…

python pandas csv datetime series
Convert list of dictionaries to a pandas DataFrame

I have a list of dictionaries like this: [{'points': 50, 'time': '5:00', 'year': 2010}, {'points': 25, 'time': '6:00', 'month': "february"}, {'points':90, …

python dictionary pandas dataframe
How to select all columns, except one column in pandas?

I have a dataframe look like this: import pandas import numpy as np df = DataFrame(np.random.rand(4,4), columns = list(…

python pandas