Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas converters example

In [6]:
pd.read_csv(io.StringIO(t), dtype={'int':'object'}, parse_dates=['date']).info()

<class 'pandas.core.frame.DataFrame'>
Int64Index: 1 entries, 0 to 0
Data columns (total 4 columns):
int      1 non-null object
float    1 non-null float64
date     1 non-null datetime64[ns]
str      1 non-null int64
dtypes: datetime64[ns](1), float64(1), int64(1), object(1)
memory usage: 40.0+ bytes
Comment

pandas converters example

In [5]:
pd.read_csv(io.StringIO(t), converters={'date':pd.to_datetime}).info()

<class 'pandas.core.frame.DataFrame'>
Int64Index: 1 entries, 0 to 0
Data columns (total 4 columns):
int      1 non-null int64
float    1 non-null float64
date     1 non-null datetime64[ns]
str      1 non-null int64
dtypes: datetime64[ns](1), float64(1), int64(2)
memory usage: 40.0 bytes
Comment

pandas converters example

In [3]:    
df = pd.read_csv(io.StringIO(t), dtype=object).info()

<class 'pandas.core.frame.DataFrame'>
Int64Index: 1 entries, 0 to 0
Data columns (total 4 columns):
int      1 non-null object
float    1 non-null object
date     1 non-null object
str      1 non-null object
dtypes: object(4)
memory usage: 40.0+ bytes
Comment

PREVIOUS NEXT
Code Example
Python :: pandas 3d tutorail pythoin 
Python :: print a box like the ones below 
Python :: How to test if a webpage is an image python requests 
Python :: get parameter value dynamo python 
Python :: if function has no argument python 
Python :: django app directory 
Python :: Kivy button on press call function with arguments 
Python :: is assimilation part of digestive system 
Python :: how to concatenate all list inside list 
Python :: copy a 2d list python 
Python :: vectorindexer pyspark 
Python :: Cget subassembly civid3d 
Python :: python tri alphabetique 
Python :: django form is onvalid 
Python :: fetch api flask url redirect 
Python :: scrapy capture: Error downloading 
Python :: filter numbers with bounds filter_bounds python 
Python :: sns countplot show only largest 
Python :: not mutable data type in python 
Python :: matruzen rechner python 
Python :: fine tune huggingface model pytorch 
Python :: print the list item dtype 
Python :: serialization in python 
Python :: default arguments 
Python :: pandas groupby and keep columns 
Python :: signup view django 
Python :: mainloop tkinter 
Python :: matplotlib get padding from bbox 
Python :: convert spark dataframe to pandas 
Python :: how to download chatterbot 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =