Category "pandas"

Showing gps points on altair world map

I'm building (for learning purposes) a python program that extracts gps-data from *jpg files in a directory and display the gps-coordinates from the photo's on

Color pandas DataFrame value if larger than 1.5*median(column)

Let's say I have a DataFrame that looks like this: df= pd.DataFrame({'A': [1,-2,0,-1,17], 'B': [11,-23,1,-3,132], 'C': [121,

Cannot convert column values to binary values

Have this census datasheet, I'm trying to replace the values of column "Income" to either 1 or 0 (1 for ">50K", 0 for "<=50K") codes are as below, but I g

Python to convert different date formats in a column

I am trying to convert a column which has different date formats. For example: month 2018-01-01 float64 2018-02-01 float64 2018-03-01

pandas read_csv() method supports zip archive reading but not to_csv() method supports zip archive saving

Pandas 0.18 supports read_csv zip file as argument and reading zipped csv table correctly into data frame. But when i am trying to use to_csv() method to save d

How Do I Return a Different Value When Iterating Over a List of Lists

ISSUE I have a FOR loop that creates a list of lists where each entry consists of the input and associated output. I can't figure out how to iterate over the o

How to extract .zst files into a pandas dataframe

I'm a bit of a beginner when it comes to Python, but one of my projects from school needs me to perform classification algorithms on this reddit popularity data

How to plot a figure with Chinese Characters in label

When I draw a figure with Chinese Character label in Python 3, it doesn't work correctly: ] My code: fig = pd.DataFrame({ '债券收௡

add a column to data frame using pandas concatenation

I have "train_df" data frame which: print(train_df.shape) returns (997, 600). now I want to concatenate a column to this data frame which: print(len(local_

Python Pandas Group by date using datetime data

I have a column Date_Time that I wish to groupby date time without creating a new column. Is this possible the current code I have does not work. df = pd.group

Change the facecolor of boxplot in pandas

I need to change the colors of the boxplot drawn using pandas utility function. I can change most properties using the color argument but can't figure out how t

Modify code to capture values greater than - instead of exact match

The following code works well for identifying whether a value is hit or missed over following rows and giving the output column showing the time the condition w

Assign remainders to specific bins in pandas.qcut()

I am trying to replicate a specific method of attributing records into deciles, and there is the pandas.qcut() function which does a good job. My only concern i

How to handle response "None" from GeoPy client using Pandas apply?

I am working on pandas dataframe with quite a few hundreds addresses, trying to add a new column with coordinates received from geopy. Main question: how to han

Convert Points to Lines Geopandas

Hello I am trying to convert a list of X and Y coordinates to lines. I want to mapped this data by groupby the IDs and also by time. My code executes successful

pandas copy value from one column to another if condition is met

I have a dataframe: df = col1 col2 col3 1 2 3 1 4 6 3 7 2 I want to edit df, such that when the value of col1 is smaller than

How can i find the "non-unique" rows?

I imported CSV files with over 500k rows, one year, every minute. To merge two of this files, i want so re-sample the index to every minute: Temp= pd.read_csv(

Converting object to datetime format in python

Below is the first row of my csv DateTime column: Mon Nov 02 20:37:10 GMT+00:00 2015 The DateTime column is currently an object and I want to convert it to dat

Integration of pandas timeframe

I want to integrate the following dataframe, such that I have the integrated value for every hour. I have roughly a 10s sampling rate, but if it is necissary to

Pandas to_sql to sqlite returns 'Engine' object has no attribute 'cursor'

I have a working_df in pandas I'd like to output to sqlite database. from sqlalchemy import create_engine sql_engine = create_engine('sqlite:///test.db', ech